/* Expecting.ai funnel styles: brand tokens, shared inputs, then the quiz and chat layouts. */
:root {
  --navy: #1d4664;
  --ink: #16324a;
  --muted: #5d7287;
  --purple: #9474cc;
  --purple-soft: #f1ecfa;
  --teal: #73c0ca;
  --yellow: #fec006;
  --line: #dfe5ec;
  --bg: #f7f6fb;
  --white: #fff;
  --danger: #c0392b;
  --grad: linear-gradient(150deg, #2b4c6b 0%, #6a6aa8 38%, #9474cc 62%, #73c0ca 100%);
  --radius: 16px;
  --shadow: 0 10px 30px rgba(29, 70, 100, .10);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 500 16px/1.5 Montserrat, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
h1, h2, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--navy); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.logo { height: 26px; width: auto; display: block; }
.logo.on-dark { filter: brightness(0) invert(1); }

/* ---------- shared inputs ---------- */
.stack { display: grid; gap: 14px; }
.btn {
  width: 100%; min-height: 54px; padding: 14px 20px; border: 0; border-radius: 14px;
  background: var(--navy); color: var(--white); font-weight: 700; font-size: 16px;
  transition: transform .12s, background .2s, opacity .2s;
}
.btn:hover { background: #163a54; }
.btn:active { transform: scale(.985); }
.btn:disabled { background: #b4c0cc; cursor: not-allowed; }
.link { background: none; border: 0; padding: 8px; color: var(--muted); font-weight: 600; text-decoration: underline; justify-self: center; }

.opts { display: grid; gap: 10px; }
.opts-2 { grid-template-columns: 1fr 1fr; }
.opts-6 { grid-template-columns: repeat(3, 1fr); }
.opt {
  min-height: 56px; padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px;
  background: var(--white); font-weight: 600; text-align: center; line-height: 1.3;
  transition: border-color .15s, background .15s, transform .12s;
}
.opts-list .opt { text-align: left; }
.opts-6 .opt { font-size: 20px; }
.opt:hover { border-color: var(--purple); }
.opt:active { transform: scale(.985); }
.opt.is-on { border-color: var(--purple); background: var(--purple-soft); }
.opt.check { position: relative; padding-left: 50px; }
.opt.check::before {
  content: ""; position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; margin-top: -11px;
  border: 2px solid #b9c4d0; border-radius: 6px; background: var(--white);
}
.opt.check.is-on::before {
  border-color: var(--purple);
  background: var(--purple) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
}
.opt.none { color: var(--muted); }

input[type=text], input[type=email], input[type=tel], select, textarea {
  width: 100%; min-height: 54px; padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px;
  background: var(--white); font-size: 16px; font-weight: 600; outline: none; transition: border-color .15s;
}
textarea { resize: vertical; min-height: 96px; font-weight: 500; }
select {
  appearance: none; padding-right: 44px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%231d4664' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") right 14px center/20px no-repeat;
}
input:focus, select:focus, textarea:focus { border-color: var(--purple); }
:focus-visible { outline: 3px solid rgba(148, 116, 204, .45); outline-offset: 2px; }
::placeholder { color: #a3b0bd; font-weight: 500; }

.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 700; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.unit { display: flex; align-items: center; gap: 10px; }
.unit span { font-weight: 700; color: var(--muted); }
.unit.lead span { font-size: 22px; }
.dob { display: grid; grid-template-columns: 1fr auto 1fr auto 1.5fr; gap: 8px; align-items: center; }
.dob input { text-align: center; font-size: 20px; padding-inline: 6px; }
.dob span { color: #b9c4d0; font-size: 22px; }

.counters { display: grid; border: 2px solid var(--line); border-radius: 14px; background: var(--white); }
.counter { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 16px; }
.counter + .counter { border-top: 1px solid var(--line); }
.counter-label { font-weight: 600; line-height: 1.25; }
.counter-label small { display: block; font-weight: 500; color: var(--muted); }
.counter-ctl { display: flex; align-items: center; gap: 4px; flex: none; }
.counter-ctl button {
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--purple-soft);
  color: var(--navy); font-size: 22px; font-weight: 700; line-height: 1;
}
.counter-ctl button:active { background: #e2d8f5; }
.counter-ctl output { width: 30px; text-align: center; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 11.5px; line-height: 1.45; color: var(--muted); font-weight: 500; }
.consent input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--navy); }
.reassure, .or { text-align: center; font-size: 13px; color: var(--muted); }
.err { color: var(--danger); font-size: 14px; font-weight: 600; }
.drop {
  display: grid; gap: 4px; justify-items: center; padding: 26px 16px; border: 2px dashed #b9c4d0; border-radius: 14px;
  background: var(--white); cursor: pointer; text-align: center;
}
.drop img { width: 132px; height: 132px; object-fit: cover; border-radius: 50%; }
.drop small { color: var(--muted); }

.end { display: grid; gap: 16px; justify-items: center; text-align: center; }
.end img { width: 44px; }
.end p { color: var(--muted); }

/* ---------- quiz ---------- */
.quiz { display: grid; grid-template-rows: auto 1fr; }
.hero { background: var(--grad); color: var(--white); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero-tag { font: 700 12px/1 Comfortaa, sans-serif; letter-spacing: .02em; opacity: .9; white-space: nowrap; }
.hero-body { display: none; }
.stage { display: flex; flex-direction: column; min-width: 0; }
.bar { display: flex; align-items: center; gap: 12px; padding: 14px 16px 0; }
.back {
  flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--white);
  box-shadow: 0 2px 8px rgba(29, 70, 100, .12); font-size: 18px; color: var(--navy);
}
.back[hidden] { display: block; visibility: hidden; }
.track { flex: 1; height: 8px; border-radius: 99px; background: #e4e1ef; overflow: hidden; }
.fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--purple), var(--teal)); transition: width .45s cubic-bezier(.2, .8, .2, 1); }
.count { flex: none; font-size: 12px; font-weight: 700; color: var(--muted); min-width: 66px; text-align: right; }
.card { width: 100%; max-width: 520px; margin: 0 auto; padding: 26px 16px 40px; display: grid; gap: 18px; align-content: start; }
.card.in { animation: rise .35s cubic-bezier(.2, .8, .2, 1); }
.card h1 { font-size: 24px; line-height: 1.25; font-weight: 700; color: var(--navy); text-wrap: balance; }
.card .help { color: var(--muted); margin-top: -8px; }
.pill {
  justify-self: start; padding: 6px 12px; border-radius: 99px; background: #e5f5ea; color: #137a3a;
  font-size: 13px; font-weight: 700;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

@media (min-width: 900px) {
  .quiz { grid-template: 1fr / minmax(360px, 42%) 1fr; }
  .hero { flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 44px 48px; position: sticky; top: 0; height: 100dvh; }
  .hero .logo { height: 32px; }
  .hero-tag { display: none; }
  .hero-body { display: grid; gap: 22px; }
  .hero-body h2 { font-size: clamp(30px, 3.1vw, 44px); line-height: 1.12; font-weight: 700; text-wrap: balance; }
  .hero-body ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 17px; }
  .hero-body li { display: flex; gap: 12px; align-items: baseline; }
  .hero-body li::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); }
  .quote { font-size: 15px; line-height: 1.55; opacity: .92; max-width: 44ch; }
  .quote b { display: block; margin-top: 8px; font-size: 14px; }
  .bar { padding: 32px 48px 0; max-width: 720px; width: 100%; margin: 0 auto; }
  .card { padding-top: 9vh; }
  .card h1 { font-size: 30px; }
}

/* ---------- chat ---------- */
.chat { background: var(--grad) fixed; }
.phone {
  height: 100dvh; max-width: 480px; margin: 0 auto; display: grid; grid-template-rows: auto 1fr auto;
  background: var(--bg); box-shadow: 0 0 60px rgba(22, 50, 74, .35);
}
.chat-head { background: var(--white); border-bottom: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--purple-soft); display: grid; place-items: center; }
.avatar img { height: 24px; }
.who b { display: block; line-height: 1.2; }
.who small { color: var(--muted); font-size: 12.5px; }
.who .logo { margin-left: auto; height: 18px; }
.chat-head .track { border-radius: 0; height: 4px; }
.chat-head .fill { border-radius: 0; }
.log { overflow-y: auto; padding: 18px 14px 8px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.msg { max-width: 84%; padding: 11px 15px; border-radius: 18px; animation: rise .3s cubic-bezier(.2, .8, .2, 1); overflow-wrap: anywhere; }
.msg.bot { align-self: flex-start; background: var(--white); border-bottom-left-radius: 6px; box-shadow: 0 1px 3px rgba(29, 70, 100, .08); }
.msg.me { align-self: flex-end; background: var(--navy); color: var(--white); border-bottom-right-radius: 6px; }
.msg.good { background: #e5f5ea; color: #0f5f2d; font-weight: 700; }
.typing { display: flex; gap: 4px; padding: 15px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #b9c4d0; animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
.dock {
  background: var(--white); border-top: 1px solid var(--line); padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  max-height: 68dvh; overflow-y: auto; display: grid; gap: 8px;
}
.dock:empty { display: none; }
.dock > .stack, .dock > .opts { animation: rise .3s cubic-bezier(.2, .8, .2, 1); }
.dock .opt { min-height: 48px; padding-block: 11px; }
.dock .btn { min-height: 50px; }
.undo { font-size: 13px; padding: 2px 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.bar[hidden] { display: none; }
a.btn { display: grid; place-items: center; text-decoration: none; }

/* ---------- warmth: reactions, moments, "why we ask" ---------- */
.note {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
  background: var(--purple-soft); color: #4a3a78; font-weight: 600; line-height: 1.4;
  animation: rise .45s cubic-bezier(.2, .8, .2, 1);
}
.note::before { content: "♥"; color: var(--purple); flex: none; }
.moment { text-align: center; justify-items: center; padding-top: 6vh; }
.moment > img { width: 40px; }
.moment h1 { font-size: 26px; }
.moment .help { margin-top: 0; }
.why {
  font-size: 13.5px; line-height: 1.45; color: var(--muted); padding: 10px 12px; border-radius: 12px;
  background: #eef6f7; border-left: 3px solid var(--teal); margin-top: -6px;
}
.why b { color: var(--navy); }
.count { min-width: 0; }
.dock-links { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.burst { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.burst i {
  position: absolute; top: -20px; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%;
  background: var(--c); animation: fall 2.6s var(--d) cubic-bezier(.3, .6, .5, 1) forwards;
}
@keyframes fall { to { transform: translateY(105vh) rotate(200deg); opacity: .2; } }
@media (min-width: 900px) { .moment h1 { font-size: 32px; } }

.opt.starter { text-align: left; font-weight: 500; font-style: italic; border-style: dashed; }
.opt.starter small { display: block; font-style: normal; font-weight: 700; color: var(--muted); margin-bottom: 4px; }

/* ---------- small things: emoji, type-ahead list, sticky button ---------- */
.emo { font-size: 1.2em; line-height: 1; margin-right: 10px; flex: none; }
.opts-list .opt:not(.check), .dock .opts-list .opt:not(.check) { display: flex; align-items: center; }
.opts-2 .emo { margin-right: 8px; }
.counter-label { display: flex; align-items: center; }
.drop .emo { font-size: 28px; margin: 0; }
input.big { text-align: center; font-size: 22px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.combo-list {
  display: grid; max-height: min(46dvh, 380px); overflow-y: auto; border: 2px solid var(--line); border-radius: 14px;
  background: var(--white); overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.combo-opt { min-height: 48px; padding: 12px 16px; border: 0; background: none; text-align: left; font-weight: 600; }
.combo-opt + .combo-opt { border-top: 1px solid var(--line); }
.combo-opt:hover, .combo-opt.is-hi { background: var(--purple-soft); }
.dock .combo-list { max-height: 34dvh; }
.hint { justify-self: start; padding: 2px 0; color: var(--navy); font-size: 14px; }
/* Long answer lists: the Continue button stays within reach instead of below the fold. */
.quiz .card .stack > .btn { position: sticky; bottom: 12px; box-shadow: 0 0 0 12px var(--bg), 0 -18px 16px 8px var(--bg); }
.quiz .card { padding-bottom: 28px; }
/* The contact form's button never floats: the consent text above it must stay fully readable. */
.quiz .card form.stack > .btn { position: static; box-shadow: none; }

/* ---------- responsive: every device class ---------- */
/* Notches and rounded corners (phones in landscape, iPads). */
.hero, .bar, .card, .who, .log, .dock {
  padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
}
.link, .undo { min-height: 40px; padding: 10px 10px; }
img { max-width: 100%; }
.card h1, .msg, .opt { overflow-wrap: anywhere; }

/* Small phones (320-359px). */
@media (max-width: 359px) {
  .card h1 { font-size: 21px; }
  .hero-tag { display: none; }
  .opt { padding-inline: 12px; }
  .opt.check { padding-left: 44px; }
  .opt.check::before { left: 12px; }
  .counter-ctl button { width: 40px; height: 40px; }
  .emo { margin-right: 8px; }
}

/* Tablets and large phones in portrait: one column, roomier. */
@media (min-width: 600px) and (max-width: 899px) {
  .hero { padding-block: 18px; }
  .hero .logo { height: 30px; }
  .card { max-width: 580px; padding-top: 40px; }
  .card h1 { font-size: 28px; }
  .bar { max-width: 612px; width: 100%; margin: 0 auto; }
}

/* Desktop: the brand panel never grows past a readable width, however wide the monitor. */
@media (min-width: 900px) {
  .quiz { grid-template: 1fr / clamp(340px, 38vw, 600px) 1fr; }
  .hero { padding: clamp(28px, 4vw, 56px); }
  .hero, .bar, .card { padding-left: clamp(28px, 4vw, 56px); padding-right: clamp(28px, 4vw, 56px); }
  .card { padding-top: clamp(24px, 8vh, 96px); max-width: 632px; }
  .bar { max-width: 760px; }
}
/* Short desktop windows and landscape tablets: drop the testimonial before anything overlaps. */
@media (min-width: 900px) and (max-height: 640px) {
  .quote { display: none; }
  .hero-body h2 { font-size: 28px; }
  .hero-body ul { font-size: 15px; gap: 8px; }
}

/* Chat on tablet and desktop: a centred conversation card instead of a full-bleed phone column. */
@media (min-width: 600px) {
  .chat { display: grid; place-items: center; padding: 24px; min-height: 100dvh; }
  .phone { width: 100%; max-width: 560px; height: min(100dvh - 48px, 860px); border-radius: 24px; overflow: hidden; }
  .msg { max-width: 78%; }
}
/* Phones in landscape: little height, so the conversation and the answer area share it tightly. */
@media (max-height: 480px) {
  .who { padding-block: 6px; }
  .avatar { width: 32px; height: 32px; }
  .who small { display: none; }
  .dock { max-height: 58dvh; padding-block: 8px; }
  .dock .opts-list { grid-template-columns: 1fr 1fr; }
  .hero { padding-block: 8px; }
  .bar { padding-top: 8px; }
  .card { padding-top: 14px; gap: 12px; }
  .moment { padding-top: 0; }
  .moment > img { display: none; }
}
/* Real photo of the guide. */
.avatar { overflow: hidden; }
.avatar img.photo { width: 100%; height: 100%; object-fit: cover; }

/* Chat: the answer area never crowds out the question it belongs to. */
.dock { max-height: 56dvh; }
@media (max-height: 480px) {
  .chat { padding: 0; }
  .phone { height: 100dvh; max-width: none; border-radius: 0; }
  .dock { max-height: 60dvh; }
  .log { padding-block: 8px 4px; }
}

.opts-3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.opts-3 .opt { display: grid; justify-items: center; gap: 4px; padding: 12px 6px; font-size: 15px; }
.opts-3 .emo { margin: 0; font-size: 1.4em; }
.combo-empty { padding: 14px 16px; color: var(--muted); font-size: 14px; }

/* ---------- quiz progress: milestones + percentage ---------- */
.bar { align-items: flex-start; }
.bar .back { margin-top: 2px; }
.prog { flex: 1; min-width: 0; display: grid; gap: 7px; padding-top: 6px; }
.prog-segs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.seg { height: 8px; border-radius: 99px; background: #e4e1ef; overflow: hidden; }
.seg i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--purple), var(--teal)); transition: width .45s cubic-bezier(.2, .8, .2, 1); }
.seg.done i { background: var(--teal); }
.prog-labels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.ms { font-size: 11px; font-weight: 600; color: #9aa7b4; line-height: 1.2; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms.now { color: var(--navy); font-weight: 700; }
.ms.done { color: var(--muted); }
.ms.done::before { content: "✓ "; color: var(--teal); }
.bar .count { padding-top: 3px; font-size: 15px; color: var(--navy); min-width: 40px; font-variant-numeric: tabular-nums; }
@media (max-width: 419px) { .ms.done::before { content: ""; } }
@media (max-width: 359px) { .ms { font-size: 10px; } }
@media (min-width: 900px) { .ms { font-size: 12.5px; } .seg { height: 9px; } }

/* ---------- quiz first screen: the ad's promise and the first question together ---------- */
.promises { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.promises li { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 99px; background: var(--white); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--navy); white-space: nowrap; }
.fine { font-size: 12px; color: var(--muted); text-align: center; }
.card.opener { padding-top: 14px; gap: 12px; }
.card.opener h1 { text-align: center; font-size: 22px; }
@media (min-width: 900px) { .card.opener h1 { font-size: 30px; } }
.card.opener h2 { font-size: 18px; line-height: 1.3; font-weight: 700; color: var(--navy); margin-top: 6px; }
.card.opener .opts { gap: 8px; }
.card.opener .opt { padding-block: 10px; }
@media (min-width: 900px) { .card.opener { padding-top: 6vh; } .card.opener h2 { font-size: 21px; } }

/* Chat answers sit under the conversation: tighter rows leave the question in view on a phone. */
.chat .dock .opts-list { gap: 7px; }
.chat .dock .opts-list .opt { padding-block: 9px; }
