/* Office Talent — Chat-Widget */

.ho-chat-panel {
  font-family: "DM Sans", system-ui, sans-serif;
}

.ho-chat-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #0f172a 100%);
}

.ho-chat-online-dot {
  position: relative;
  display: inline-flex;
  height: 0.5rem;
  width: 0.5rem;
  flex-shrink: 0;
}

.ho-chat-online-dot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: #34d399;
  animation: ho-chat-ping 1.4s cubic-bezier(0, 0, 0.2, 1) infinite;
  opacity: 0.65;
}

.ho-chat-online-dot::after {
  content: "";
  position: relative;
  display: block;
  height: 0.5rem;
  width: 0.5rem;
  border-radius: 9999px;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

@keyframes ho-chat-ping {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  70% {
    transform: scale(2.2);
    opacity: 0;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

.ho-chat-steps {
  display: flex;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
}

.ho-chat-step {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.2;
  color: #94a3b8;
  position: relative;
  padding-top: 1.25rem;
}

.ho-chat-step::before {
  content: attr(data-step);
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ho-chat-step.is-done {
  color: #059669;
}

.ho-chat-step.is-done::before {
  content: "✓";
  background: #d1fae5;
  color: #047857;
}

.ho-chat-step.is-active {
  color: #0f172a;
}

.ho-chat-step.is-active::before {
  background: #0f172a;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.12);
}

.ho-chat-flow {
  flex-shrink: 0;
  max-height: min(42vh, 280px);
  overflow-y: auto;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

/* Onboarding: Formular nutzt freien Platz zwischen Schritte und unterem Rand */
.ho-chat-flow--expand {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none !important;
}

.ho-chat-thread--hidden {
  display: none !important;
  flex: 0 0 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.ho-chat-composer--hidden {
  display: none !important;
}

.ho-chat-flow-card {
  margin: 0.75rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.ho-chat-flow-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

.ho-chat-flow-card p {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #64748b;
}

.ho-chat-field {
  display: block;
  width: 100%;
  margin-bottom: 0.5rem;
}

.ho-chat-field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.2rem;
}

.ho-chat-field input,
.ho-chat-field textarea {
  width: 100%;
  border-radius: 0.65rem;
  border: 1px solid #e2e8f0;
  padding: 0.5rem 0.65rem;
  font-size: 0.875rem;
  color: #0f172a;
  background: #fff;
}

.ho-chat-field input:focus,
.ho-chat-field textarea:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
}

.ho-chat-btn-primary {
  width: 100%;
  margin-top: 0.35rem;
  border-radius: 0.75rem;
  background: #0f172a;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.ho-chat-btn-primary:hover {
  background: #1e293b;
}

.ho-chat-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ho-chat-btn-secondary {
  width: 100%;
  margin-top: 0.4rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.ho-chat-btn-secondary:hover {
  background: #f8fafc;
}

.ho-chat-success {
  text-align: center;
  padding: 0.5rem 0;
}

.ho-chat-success-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.65rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #047857;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ho-chat-thread {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  background: #f8fafc;
  padding: 0.75rem;
}

.ho-chat-thread-placeholder {
  font-size: 0.75rem;
  line-height: 1.4;
  padding: 0.65rem 0;
}

.ho-chat-composer.is-locked input {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.ho-chat-launcher {
  position: fixed;
  bottom: max(1rem, env(safe-area-inset-bottom));
  right: max(1rem, env(safe-area-inset-right));
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #0f172a, #1e3a5f);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.85rem 1.25rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
  transition: transform 0.15s, box-shadow 0.15s;
}

.ho-chat-launcher:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.32);
}

/* Mobil: volle Höhe; Formularbereich kann einrollen (--expand) */
@media (max-width: 639px) {
  .ho-chat-panel {
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
  }

  .ho-chat-flow {
    max-height: min(38vh, 252px);
  }

  .ho-chat-flow--expand {
    max-height: none !important;
  }

  .ho-chat-thread-placeholder {
    font-size: 0.625rem;
    line-height: 1.3;
    padding: 0.2rem 0;
  }

  .ho-chat-composer {
    padding: 0.45rem 0.65rem;
    padding-bottom: max(0.45rem, env(safe-area-inset-bottom));
  }

  .ho-chat-composer.is-locked {
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  }

  .ho-chat-composer-row {
    gap: 0.35rem;
  }

  .ho-chat-input-el {
    padding: 0.4rem 0.65rem !important;
    font-size: 0.8125rem !important;
  }

  .ho-chat-send-btn {
    align-self: flex-end;
    width: auto !important;
    padding: 0.28rem 0.8rem !important;
    font-size: 0.6875rem !important;
    font-weight: 600;
    border-radius: 0.55rem;
    margin-top: 0.08rem;
  }
}

@media (min-width: 640px) {
  .ho-chat-panel {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    left: auto;
    top: auto;
    inset: auto;
    width: min(100vw - 2rem, 400px);
    height: min(92vh, 560px);
    border-radius: 1.25rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  }

  .ho-chat-flow {
    max-height: 240px;
  }
}
