/* ============================================================
   ami – Design System & Global Styles
   Prototype · v0.1
   ============================================================ */

/* ── Fonts ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  /* Brand Colors */
  --coral:       #FF6F5A;
  --blue:        #214DA0;
  --cream:       #F8F3EC;
  --navy:        #1F2E45;
  --sand:        #EFE4D6;
  --rose:        #F3D7D2;
  --ink:         #2B2F36;
  --warm-gray:   #7A746E;
  --white:       #FFFFFF;

  /* Coral tints */
  --coral-light: #FFF0EE;
  --coral-mid:   #FFD4CE;

  /* Blue tints */
  --blue-light:  #EEF2FA;
  --blue-mid:    #C2CEEB;

  /* Typography */
  --font-head: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  /* Font sizes – fluid */
  --text-xs:   clamp(0.75rem,  1vw, 0.8125rem);
  --text-sm:   clamp(0.875rem, 1.2vw, 0.9375rem);
  --text-base: clamp(1rem,     1.5vw, 1.0625rem);
  --text-md:   clamp(1.125rem, 1.8vw, 1.25rem);
  --text-lg:   clamp(1.25rem,  2vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   2.5vw, 2rem);
  --text-2xl:  clamp(2rem,     4vw, 3rem);
  --text-3xl:  clamp(2.5rem,   5vw, 4rem);
  --text-hero: clamp(2.75rem,  6vw, 5rem);

  /* Spacing */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

  /* Radius */
  --r-sm:   10px;
  --r-md:   18px;
  --r-lg:   24px;
  --r-xl:   32px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 4px rgba(31,46,69,.06), 0 2px 8px rgba(31,46,69,.04);
  --shadow-md:  0 4px 16px rgba(31,46,69,.08), 0 1px 4px rgba(31,46,69,.04);
  --shadow-lg:  0 8px 32px rgba(31,46,69,.10), 0 2px 8px rgba(31,46,69,.05);

  /* Transitions */
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --transition: 220ms var(--ease-soft);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}
a:hover { opacity: .8; }

ul, ol { list-style: none; }

/* ── Layout Utilities ───────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.container--narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.section {
  padding: var(--sp-20) 0;
}

.section--lg {
  padding: var(--sp-24) 0;
}

/* ── Logo ───────────────────────────────────────────────────── */
.ami-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
}

/* SVG logo placeholder – replace with <img src="logo.svg"> when asset is available */
.ami-logo__wordmark {
  font-family: var(--font-head);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1;
  user-select: none;
}

.ami-logo__wordmark span {
  color: var(--coral);
}

/* ── Navigation ─────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248,243,236,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(239,228,214,.6);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}

.nav__links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.nav__links a:hover { color: var(--blue); opacity: 1; }

.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.nav__mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  padding: var(--sp-2);
}

@media (max-width: 720px) {
  .nav__links { display: none; }
  .nav__mobile-toggle { display: flex; }
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.7em 1.5em;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition),
              box-shadow var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}
.btn--primary:hover {
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: var(--shadow-md);
  opacity: 1;
  color: var(--white);
}

.btn--secondary {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}
.btn--secondary:hover {
  background: var(--blue-light);
  opacity: 1;
  color: var(--blue);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: transparent;
}
.btn--ghost:hover {
  background: var(--sand);
  color: var(--ink);
  opacity: 1;
}

.btn--coral {
  background: var(--coral);
  color: var(--white);
  border-color: var(--coral);
}
.btn--coral:hover {
  background: #e85e49;
  border-color: #e85e49;
  box-shadow: var(--shadow-md);
  opacity: 1;
  color: var(--white);
}

.btn--lg {
  padding: 0.85em 2em;
  font-size: var(--text-base);
}

.btn--full { width: 100%; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  box-shadow: var(--shadow-sm);
}

.card--sand {
  background: var(--sand);
  box-shadow: none;
}

.card--cream {
  background: var(--cream);
  box-shadow: none;
}

/* ── Form Elements ───────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.8em 1em;
  border: 1.5px solid var(--sand);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--warm-gray);
  opacity: .7;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(33,77,160,.12);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

/* ── Typography helpers ──────────────────────────────────────── */
.eyebrow {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--coral);
}

.headline {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.15;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.headline--hero  { font-size: var(--text-hero); }
.headline--xl    { font-size: var(--text-3xl); }
.headline--lg    { font-size: var(--text-2xl); }
.headline--md    { font-size: var(--text-xl); }
.headline--sm    { font-size: var(--text-lg); }

.body-text {
  font-size: var(--text-base);
  color: var(--warm-gray);
  line-height: 1.75;
  font-weight: 400;
}

.body-text--ink { color: var(--ink); }

.text-center { text-align: center; }

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  background: var(--cream);
  padding: var(--sp-24) 0 var(--sp-20);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -80px;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243,215,210,.5) 0%, transparent 70%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.hero__logo {
  margin-bottom: var(--sp-10);
}

.hero__logo .ami-logo__wordmark {
  font-size: 2.5rem;
}

.hero__eyebrow {
  margin-bottom: var(--sp-4);
}

.hero__headline {
  margin-bottom: var(--sp-6);
}

.hero__sub {
  font-size: var(--text-md);
  color: var(--warm-gray);
  line-height: 1.75;
  margin-bottom: var(--sp-10);
  max-width: 560px;
}

.hero__actions {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  align-items: center;
}

.hero__note {
  margin-top: var(--sp-5);
  font-size: var(--text-xs);
  color: var(--warm-gray);
}

/* ── Section headers ─────────────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: var(--sp-12);
}

.section-header .eyebrow {
  margin-bottom: var(--sp-3);
}

.section-header .headline {
  margin-bottom: var(--sp-4);
}

.section-header .body-text {
  max-width: 560px;
  margin: 0 auto;
}

/* ── Steps / How it works ────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-6);
}

.step {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: var(--sp-8) var(--sp-6);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.step__number {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 600;
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-5);
}

.step__title {
  font-family: var(--font-head);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--sp-3);
}

.step__desc {
  font-size: var(--text-sm);
  color: var(--warm-gray);
  line-height: 1.7;
}

/* ── Benefits grid ───────────────────────────────────────────── */
.benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-5);
}

.benefit {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  box-shadow: var(--shadow-sm);
}

.benefit__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--coral-light);
  color: var(--coral);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-5);
}

.benefit__icon svg { width: 22px; height: 22px; }

.benefit__title {
  font-family: var(--font-head);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--sp-3);
  line-height: 1.3;
}

.benefit__desc {
  font-size: var(--text-sm);
  color: var(--warm-gray);
  line-height: 1.7;
}

/* ── Values section ──────────────────────────────────────────── */
.values-section {
  background: var(--navy);
  color: var(--white);
  padding: var(--sp-20) 0;
}

.values-section .eyebrow {
  color: var(--coral);
  opacity: .8;
}

.values-section .headline { color: var(--white); }

.values-section .body-text { color: rgba(255,255,255,.7); }

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-10);
}

.value-pill {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r-md);
  padding: var(--sp-5) var(--sp-4);
  text-align: center;
}

.value-pill__label {
  font-family: var(--font-head);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--white);
  display: block;
  margin-bottom: var(--sp-1);
}

.value-pill__sub {
  font-size: var(--text-xs);
  color: rgba(255,255,255,.5);
}

.values-quote {
  background: rgba(255,255,255,.06);
  border-left: 3px solid var(--coral);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: var(--sp-6) var(--sp-8);
  margin-top: var(--sp-10);
}

.values-quote p {
  font-size: var(--text-md);
  color: rgba(255,255,255,.85);
  font-style: italic;
  line-height: 1.7;
}

/* ── Safety section ──────────────────────────────────────────── */
.safety-section {
  background: var(--sand);
  padding: var(--sp-20) 0;
}

.safety-box {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: var(--sp-10) var(--sp-12);
  box-shadow: var(--shadow-sm);
  max-width: 760px;
  margin: 0 auto;
}

.safety-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin: var(--sp-5) 0;
}

.safety-list li {
  background: var(--rose);
  color: var(--navy);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-full);
}

.safety-note {
  font-size: var(--text-sm);
  color: var(--warm-gray);
  line-height: 1.7;
  margin-top: var(--sp-5);
}

.safety-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: 500;
  background: var(--coral-light);
  color: var(--coral);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-full);
  margin-bottom: var(--sp-5);
}

/* ── Auth / Form page ────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  flex-direction: column;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-12) var(--sp-6);
}

.auth-box {
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border-radius: var(--r-xl);
  padding: var(--sp-10) var(--sp-10);
  box-shadow: var(--shadow-lg);
}

.auth-box__logo {
  text-align: center;
  margin-bottom: var(--sp-8);
}

.auth-box__title {
  font-family: var(--font-head);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--sp-2);
  text-align: center;
}

.auth-box__sub {
  font-size: var(--text-sm);
  color: var(--warm-gray);
  text-align: center;
  margin-bottom: var(--sp-8);
  line-height: 1.6;
}

.auth-box__footer {
  text-align: center;
  margin-top: var(--sp-6);
  font-size: var(--text-sm);
  color: var(--warm-gray);
}

.auth-box__footer a { color: var(--blue); font-weight: 500; }

/* ── Onboarding ──────────────────────────────────────────────── */
.onboarding-page {
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  flex-direction: column;
}

.onboarding-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-12) var(--sp-6);
}

.onboarding-card {
  width: 100%;
  max-width: 620px;
  background: var(--white);
  border-radius: var(--r-xl);
  padding: var(--sp-10) var(--sp-10) var(--sp-8);
  box-shadow: var(--shadow-lg);
}

.onboarding-progress {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-8);
}

.onboarding-progress__dot {
  height: 4px;
  flex: 1;
  border-radius: var(--r-full);
  background: var(--sand);
  transition: background var(--transition);
}

.onboarding-progress__dot--active {
  background: var(--coral);
}

.onboarding-progress__dot--done {
  background: var(--blue);
}

.onboarding-step {
  display: none;
}

.onboarding-step--active {
  display: block;
  animation: fadeIn 300ms var(--ease-soft);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.onboarding-question {
  font-family: var(--font-head);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: var(--sp-6);
}

.onboarding-options {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.option-btn {
  width: 100%;
  padding: var(--sp-4) var(--sp-6);
  background: var(--cream);
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  text-align: left;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--ink);
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.4;
}

.option-btn:hover {
  background: var(--blue-light);
  border-color: var(--blue-mid);
  color: var(--navy);
}

.option-btn--selected {
  background: var(--blue-light);
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 500;
}

.onboarding-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--sand);
}

.onboarding-counter {
  font-size: var(--text-xs);
  color: var(--warm-gray);
}

/* ── Chat ────────────────────────────────────────────────────── */
.chat-page {
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  flex-direction: column;
}

.chat-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: var(--sp-6);
  gap: var(--sp-5);
  align-items: start;
}

.chat-sidebar {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 80px;
}

.chat-sidebar__title {
  font-family: var(--font-head);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--sand);
}

.chat-history {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.chat-history__item {
  padding: var(--sp-4);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  background: var(--cream);
  border: 1px solid transparent;
}

.chat-history__item:hover { background: var(--sand); }

.chat-history__item--active {
  background: var(--blue-light);
  border: 1px solid var(--blue-mid);
}

.chat-history__item-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink);
  margin-bottom: var(--sp-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-history__item-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}

.chat-history__delete {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--warm-gray);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}

.chat-history__delete:hover {
  background: rgba(31, 46, 69, .08);
  color: var(--navy);
}

.chat-history__item-date {
  font-size: var(--text-xs);
  color: var(--warm-gray);
}

.chat-sidebar__new {
  width: 100%;
}

.chat-main {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-height: calc(100vh - 120px);
  max-height: calc(100vh - 120px);
}

.chat-header {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--sand);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chat-header__info {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.chat-header__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  color: var(--blue);
}

.chat-header__name {
  font-weight: 500;
  color: var(--navy);
  font-size: var(--text-sm);
}

.chat-header__status {
  font-size: var(--text-xs);
  color: var(--warm-gray);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  scroll-behavior: smooth;
}

/* Custom scrollbar */
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--sand); border-radius: 4px; }

.message {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-end;
  animation: fadeIn 250ms var(--ease-soft);
}

.message--ami {
  flex-direction: row;
}

.message--user {
  flex-direction: row-reverse;
}

.message__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.message__avatar--ami {
  background: var(--blue-light);
  color: var(--blue);
  font-family: var(--font-head);
}

.message__avatar--user {
  background: var(--sand);
  color: var(--ink);
}

.message__bubble {
  max-width: 72%;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  line-height: 1.7;
}

.message__bubble--ami {
  background: var(--cream);
  color: var(--ink);
  border-bottom-left-radius: var(--r-sm);
}

.message__bubble--user {
  background: var(--blue);
  color: var(--white);
  border-bottom-right-radius: var(--r-sm);
}

/* Markdown-Formatierung in ami-Nachrichten */
.message__bubble--ami p { margin: 0 0 var(--sp-2) 0; }
.message__bubble--ami p:last-child { margin-bottom: 0; }
.message__bubble--ami strong { font-weight: 600; }
.message__bubble--ami em { font-style: italic; }
.message__bubble--ami ul,
.message__bubble--ami ol { margin: var(--sp-2) 0 var(--sp-2) var(--sp-4); padding: 0; }
.message__bubble--ami li { margin-bottom: var(--sp-1); }

.message__time {
  font-size: var(--text-xs);
  color: var(--warm-gray);
  text-align: right;
  margin-top: var(--sp-1);
}

.message--ami .message__time { text-align: left; }

.message__typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
}

.message__typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--warm-gray);
  animation: typing 1.2s infinite;
}

.message__typing span:nth-child(2) { animation-delay: .2s; }
.message__typing span:nth-child(3) { animation-delay: .4s; }

@keyframes typing {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30%            { opacity: 1;  transform: translateY(-4px); }
}

.chat-input-area {
  padding: var(--sp-4) var(--sp-6) var(--sp-5);
  border-top: 1px solid var(--sand);
  flex-shrink: 0;
}

.chat-input-area__inner {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  padding: 0.75em 1em;
  border: 1.5px solid var(--sand);
  border-radius: var(--r-lg);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--ink);
  background: var(--white);
  resize: none;
  line-height: 1.5;
  max-height: 140px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.chat-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(33,77,160,.10);
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), transform var(--transition);
}

.chat-send-btn:hover { background: var(--navy); }
.chat-send-btn:active { transform: scale(.94); }
.chat-send-btn:disabled { background: var(--sand); color: var(--warm-gray); cursor: not-allowed; }

.chat-input-hint {
  font-size: var(--text-xs);
  color: var(--warm-gray);
  margin-top: var(--sp-2);
  text-align: center;
}

.chat-error-bar {
  display: none;
  background: var(--rose);
  color: var(--navy);
  font-size: var(--text-xs);
  padding: var(--sp-3) var(--sp-5);
  text-align: center;
  font-weight: 500;
}

.chat-error-bar--visible { display: block; }

/* ── Mobile Chat ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .chat-layout {
    grid-template-columns: 1fr;
    padding: 0;
  }
  .chat-sidebar { display: none; }
  .chat-main { min-height: calc(100vh - 60px); max-height: calc(100vh - 60px); }
  .chat-messages {
    padding: var(--sp-3) var(--sp-3);
    gap: var(--sp-3);
  }
  .message__bubble {
    max-width: 88%;
    padding: var(--sp-3) var(--sp-4);
    font-size: var(--text-base);
  }
  .message__avatar {
    width: 26px;
    height: 26px;
    font-size: 0.65rem;
  }
  .message {
    gap: var(--sp-2);
  }
  .chat-input-area {
    padding: var(--sp-2) var(--sp-3) var(--sp-3);
  }
  .chat-header {
    padding: var(--sp-3) var(--sp-3);
  }
}

/* ── Feedback ────────────────────────────────────────────────── */
.feedback-page {
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  flex-direction: column;
}

.feedback-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-12) var(--sp-6);
}

.feedback-card {
  width: 100%;
  max-width: 600px;
  background: var(--white);
  border-radius: var(--r-xl);
  padding: var(--sp-10);
  box-shadow: var(--shadow-lg);
}

.rating-group {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.rating-btn {
  flex: 1;
  padding: var(--sp-3) 0;
  border: 1.5px solid var(--sand);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--warm-gray);
  background: var(--cream);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.rating-btn:hover, .rating-btn--active {
  background: var(--blue-light);
  border-color: var(--blue);
  color: var(--blue);
}

/* ── Closing / Thank you ─────────────────────────────────────── */
.closing-page {
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-12) var(--sp-6);
  text-align: center;
}

.closing-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-8);
}

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,.6);
  padding: var(--sp-10) 0;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.footer__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-6);
}

.footer__logo .ami-logo__wordmark {
  color: var(--white);
  font-size: 1.5rem;
}

.footer__logo .ami-logo__wordmark span { color: var(--coral); }

.footer__tagline {
  font-size: var(--text-xs);
  color: rgba(255,255,255,.4);
  margin-top: var(--sp-2);
}

.footer__links {
  display: flex;
  gap: var(--sp-5);
  flex-wrap: wrap;
}

.footer__links a {
  font-size: var(--text-sm);
  color: rgba(255,255,255,.55);
}

.footer__links a:hover { color: var(--white); }

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: var(--sp-5);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.footer__copy {
  font-size: var(--text-xs);
  color: rgba(255,255,255,.3);
}

.footer__test-badge {
  font-size: var(--text-xs);
  background: rgba(255,111,90,.15);
  color: var(--coral);
  padding: var(--sp-1) var(--sp-4);
  border-radius: var(--r-full);
}

/* ── Utilities ───────────────────────────────────────────────── */
.mt-2  { margin-top: var(--sp-2); }
.mt-4  { margin-top: var(--sp-4); }
.mt-6  { margin-top: var(--sp-6); }
.mt-8  { margin-top: var(--sp-8); }
.mt-10 { margin-top: var(--sp-10); }
.mb-4  { margin-bottom: var(--sp-4); }
.mb-6  { margin-bottom: var(--sp-6); }
.mb-8  { margin-bottom: var(--sp-8); }
.flex  { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }

/* ── Prototype notice ────────────────────────────────────────── */
.proto-banner {
  background: var(--coral-light);
  border-bottom: 1px solid var(--coral-mid);
  padding: var(--sp-2) var(--sp-6);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--coral);
  font-weight: 500;
}

/* ── CTA Section ─────────────────────────────────────────────── */
.cta-section {
  background: var(--blue);
  padding: var(--sp-20) 0;
  text-align: center;
}

.cta-section .headline { color: var(--white); }

.cta-section .body-text {
  color: rgba(255,255,255,.72);
  max-width: 480px;
  margin: var(--sp-5) auto var(--sp-8);
}

/* ── Legal pages ─────────────────────────────────────────────── */
.legal-page {
  min-height: 100vh;
  background: var(--cream);
}

.legal-content {
  max-width: 740px;
  margin: 0 auto;
  padding: var(--sp-16) var(--sp-6);
}

.legal-content h1 {
  font-family: var(--font-head);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--sp-8);
}

.legal-content h2 {
  font-family: var(--font-head);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--navy);
  margin: var(--sp-8) 0 var(--sp-4);
}

.legal-content p {
  color: var(--warm-gray);
  line-height: 1.8;
  margin-bottom: var(--sp-4);
}

.legal-content a { color: var(--blue); }

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--sand);
  margin: var(--sp-8) 0;
}
