/* ZfS Style-Token (Design-Variablen) */
.zfs-trauma-chat-wrapper {
  /* Basisfarben */
  --zfs-color-primary: #466e6e;
  --zfs-color-primary-dark: #233c5a;

  /* Akzentfarben */
  --zfs-color-accent-warm: #f7c77b;
  --zfs-color-accent-soft: #E6E6E6;

  /* Flächen & Rahmen */
  --zfs-color-surface: #f7faf9;
  --zfs-color-border-soft: rgba(70, 110, 110, 0.18);
  --zfs-color-border-input: rgba(35, 60, 90, 0.25);

  /* Textfarben */
  --zfs-color-text-main: #233c5a;
  --zfs-color-text-muted: #466e6e;
  --zfs-color-text-on-primary: #ffffff;

  /* Sonstiges */
  --zfs-radius-card: 18px;
  --zfs-radius-pill: 999px;
  --zfs-shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.06);
}

/* Wrapper-Grundlayout */
.zfs-trauma-chat-wrapper {
  max-width: 720px;
  margin: 2rem auto;
  padding: 1.5rem;
  border-radius: var(--zfs-radius-card);
  background: var(--zfs-color-surface);
  border: 1px solid var(--zfs-color-border-soft);
  box-shadow: var(--zfs-shadow-soft);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--zfs-color-text-main);
}

/* Header */
.zfs-trauma-chat-header {
  margin-bottom: 1.25rem;
}

.zfs-trauma-chat-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--zfs-color-primary-dark);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.zfs-trauma-chat-subtitle {
  margin-top: 0.25rem;
  font-size: 0.95rem;
  color: var(--zfs-color-text-muted);
}

/* Trial-Bereich */
.zfs-trauma-chat-trial {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: #e0f2f1;
  border: 1px solid rgba(70, 110, 110, 0.3);
}

.zfs-trauma-chat-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--zfs-color-primary-dark);
  margin-bottom: 0.35rem;
}

.zfs-trauma-chat-email-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.zfs-trauma-chat-email {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--zfs-radius-pill);
  border: 1px solid var(--zfs-color-border-input);
  font-size: 0.95rem;
  outline: none;
}

.zfs-trauma-chat-email:focus {
  border-color: var(--zfs-color-primary);
  box-shadow: 0 0 0 2px rgba(70, 110, 110, 0.2);
}

.zfs-trauma-chat-trial-hint {
  font-size: 0.8rem;
  color: var(--zfs-color-text-muted);
}

/* Chat-Body */
.zfs-trauma-chat-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.zfs-trauma-chat-messages {
  max-height: 420px;
  overflow-y: auto;
  padding: 0.75rem 0.25rem;
}

/* Scrollbar dezent */
.zfs-trauma-chat-messages::-webkit-scrollbar {
  width: 6px;
}
.zfs-trauma-chat-messages::-webkit-scrollbar-thumb {
  border-radius: var(--zfs-radius-pill);
  background: rgba(35, 60, 90, 0.2);
}

/* Message-Bubbles */
.zfs-msg {
  padding: 0.55rem 0.9rem;
  border-radius: 14px;
  margin-bottom: 0.4rem;
  max-width: 80%;
  white-space: pre-wrap;
  font-size: 0.95rem;
  line-height: 1.4;
}

.zfs-msg-user {
  background: var(--zfs-color-primary);
  color: var(--zfs-color-text-on-primary);
  margin-left: auto;
  text-align: right;
  border-bottom-right-radius: 4px;
}

.zfs-msg-assistant {
  background: var(--zfs-color-accent-soft);
  color: var(--zfs-color-text-main);
  margin-right: auto;
  border-bottom-left-radius: 4px;
}

/* Input-Bereich */
.zfs-trauma-chat-input-wrapper {
  margin-top: 0.5rem;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(35, 60, 90, 0.15);
  padding: 0.75rem;
}

.zfs-trauma-chat-input {
  width: 100%;
  border: none;
  resize: vertical;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  min-height: 70px;
}

.zfs-trauma-chat-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  gap: 0.75rem;
}

/* Senden-Button */
.zfs-trauma-chat-send {
  border: none;
  border-radius: var(--zfs-radius-pill);
  background-color: #466E6E !important;
  color: #ffffff !important;
  font-weight: 600;
  padding: 0.4rem 1.1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease,
    opacity 0.08s ease;
}

.zfs-trauma-chat-send:hover {
  background: #466E6E;
  color: #ffffff;
}

.zfs-trauma-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Statuszeile */
.zfs-trauma-chat-status {
  font-size: 0.8rem;
  color: var(--zfs-color-text-muted);
}

/* Trial abgelaufen + CTA */
.zfs-trial-expired-msg {
  font-size: 0.9rem;
  color: var(--zfs-color-text-main);
  margin-bottom: 0.5rem;
}

.zfs-trial-cta-wrapper {
  margin-top: 0.25rem;
  display: flex;
  justify-content: end;
}

.zfs-trial-cta-button {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: var(--zfs-radius-pill);
  background: var(--zfs-color-primary-dark);
  color: #fff !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

/* Kleine Screens */
@media (max-width: 600px) {
  .zfs-trauma-chat-wrapper {
    margin: 1rem;
    padding: 1rem;
  }

  .zfs-msg {
    max-width: 90%;
  }
}
/* Schreib-Indikator ("Der Begleiter schreibt …") */
.zfs-typing-indicator {
  display: none;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--zfs-color-text-muted);
}

.zfs-typing-indicator.is-active {
  display: inline-flex;
}

.zfs-typing-dots {
  display: inline-flex;
  gap: 0.18rem;
}

.zfs-typing-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--zfs-color-text-muted);
  opacity: 0.4;
  animation: zfs-typing-bounce 1s infinite ease-in-out;
}

.zfs-typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.zfs-typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes zfs-typing-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.3;
  }
  40% {
    transform: translateY(-3px);
    opacity: 0.8;
  }
}
