:root {
  --primary: #5E8B7E;
  --primaryDark: #3E5E54;
  --accent: #C98A6B;
  --soft: #ECF1ED;
  --bg: #F7F4EE;
  --surface: #FFFFFF;
  --text: #2B332F;
  --muted: #6A7470;
  --ring: rgba(94, 139, 126, .3);
  --line: rgba(17, 17, 17, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 26rem),
    radial-gradient(circle at 90% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 24rem),
    var(--bg);
}

button, input, select { font: inherit; }

.app-shell {
  display: grid;
  gap: 1rem;
  align-items: start;
  width: min(900px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 2.5rem;
}

/* brand */
.brand-panel { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.logo-mark { display: flex; align-items: center; gap: .7rem; color: var(--text); text-decoration: none; }
.brand-avatar {
  width: 2.85rem; height: 2.85rem; border-radius: 50%; object-fit: cover; object-position: 50% 18%;
  border: 2px solid var(--surface); box-shadow: 0 0 0 2px var(--primary);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 1.02rem; letter-spacing: -.01em; }
.brand-role { font-size: .8rem; color: var(--muted); }
.parent-note {
  padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  box-shadow: 0 .6rem 2rem var(--ring); backdrop-filter: blur(10px);
  color: var(--muted); font-size: .9rem; white-space: nowrap;
}
.parent-note strong { color: var(--primaryDark); font-weight: 700; }

/* card */
.flow-card {
  padding: clamp(1.1rem, 3vw, 2rem);
  border: 1px solid var(--line); border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 1.4rem 4rem rgba(20, 30, 40, .14);
}

/* progress */
.progress-wrap { display: grid; grid-template-columns: 2.4rem 1fr 3.4rem; gap: .75rem; align-items: center; }
.icon-button {
  width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.icon-button:hover:not(:disabled) { background: var(--soft); border-color: var(--primary); }
.icon-button:disabled { opacity: .35; cursor: not-allowed; }
.progress-track { position: relative; height: .55rem; border-radius: 999px; background: var(--soft); overflow: hidden; }
.progress-track span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--primary); border-radius: 999px; transition: width .35s ease; }
.progress-copy { text-align: right; font-size: .85rem; font-weight: 700; color: var(--muted); }

/* conversation */
.conversation { display: flex; gap: 1rem; align-items: flex-start; margin: 1.5rem 0 1.25rem; }
.buddy-wrap { position: relative; flex: 0 0 auto; }
.buddy-wrap img {
  width: 3.6rem; height: 3.6rem; border-radius: 50%; object-fit: cover; object-position: 50% 16%;
  border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--primary);
}
.buddy-pulse {
  position: absolute; right: .1rem; bottom: .1rem; width: .8rem; height: .8rem; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface);
}
.speech-card { min-width: 0; }
.eyebrow { margin: 0 0 .35rem; font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--primaryDark); }
#questionTitle { margin: 0 0 .4rem; font-size: clamp(1.3rem, 3.2vw, 1.75rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
#questionLead { margin: 0; color: var(--muted); font-size: 1rem; }

/* visuals */
.visual-area:not(:empty) { margin: 1rem 0 1.25rem; }
.intro-visual { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; background: var(--soft); border-radius: 18px; padding: 1.1rem 1.25rem; }
.mini-dashboard { display: grid; gap: .5rem; }
.dash-row { display: flex; align-items: center; gap: .6rem; font-size: .95rem; }
.dash-icon { display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem; border-radius: 8px; background: var(--surface); color: var(--primaryDark); font-weight: 800; box-shadow: 0 .3rem .9rem var(--ring); }
.growth-orbit { position: relative; width: 5.5rem; height: 5.5rem; display: grid; place-items: center; }
.orbit-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px dashed color-mix(in srgb, var(--primary) 45%, transparent); animation: spin 14s linear infinite; }
.orbit-core { font-weight: 800; font-size: 1.3rem; color: var(--primaryDark); background: var(--surface); width: 3.1rem; height: 3.1rem; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 .5rem 1.4rem var(--ring); }
@keyframes spin { to { transform: rotate(360deg); } }
.result-visual { background: var(--soft); border-radius: 18px; padding: 1rem 1.1rem; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.result-pill { background: var(--surface); border-radius: 14px; padding: .7rem .8rem; box-shadow: 0 .3rem 1rem var(--ring); }
.result-pill span { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; font-weight: 700; }
.result-pill strong { display: block; margin-top: .15rem; font-size: .95rem; color: var(--primaryDark); }

/* options */
.options-area { display: grid; gap: .7rem; }
.options-area.answer-grid { grid-template-columns: repeat(2, 1fr); }
.options-area.action-only { grid-template-columns: 1fr; }
.option-card {
  display: flex; align-items: center; gap: .8rem; text-align: left; width: 100%;
  padding: 1rem 1.1rem; border: 1.5px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: transform .12s, border-color .12s, box-shadow .12s, background .12s;
}
.option-card:hover { border-color: var(--primary); box-shadow: 0 .7rem 1.6rem var(--ring); transform: translateY(-1px); }
.answer-emoji { font-size: 1.5rem; flex: 0 0 auto; line-height: 1; }
.answer-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.answer-body strong { font-weight: 700; font-size: 1rem; }
.answer-body small { color: var(--muted); font-size: .82rem; }
.action-card { justify-content: center; background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 800; font-size: 1.05rem; padding: 1.05rem; }
.action-card:hover { background: var(--primaryDark); border-color: var(--primaryDark); }

/* buttons */
.primary-action {
  width: 100%; margin-top: .25rem; padding: 1.05rem 1.2rem; border: none; border-radius: 14px;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 1.05rem; cursor: pointer;
  box-shadow: 0 .8rem 2rem var(--ring); transition: background .15s, transform .12s;
}
.primary-action:hover:not(:disabled) { background: var(--primaryDark); transform: translateY(-1px); }
.primary-action:disabled { opacity: .55; cursor: not-allowed; }
.secondary-action { margin-top: .6rem; padding: .7rem 1.1rem; border: 1.5px solid var(--primary); border-radius: 12px; background: var(--surface); color: var(--primaryDark); font-weight: 700; cursor: pointer; }

/* booking */
.booking-area { margin-top: .5rem; }
.booking-panel { border: 1px solid var(--line); border-radius: 18px; padding: 1rem; background: color-mix(in srgb, var(--soft) 50%, var(--surface)); }
.booking-state { text-align: center; padding: 1.5rem 1rem; }
.booking-state strong { display: block; font-size: 1.05rem; margin-bottom: .3rem; }
.booking-state p { margin: 0 0 .6rem; color: var(--muted); }
.booking-picker { display: grid; gap: 1rem; }
.booking-calendar { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .3rem; }
.booking-day { flex: 0 0 auto; display: grid; gap: .1rem; width: 4.3rem; padding: .6rem .3rem; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); cursor: pointer; text-align: center; transition: border-color .12s, background .12s; }
.booking-day span { font-size: .72rem; color: var(--muted); text-transform: uppercase; }
.booking-day strong { font-size: 1.25rem; }
.booking-day small { font-size: .72rem; color: var(--muted); }
.booking-day:hover { border-color: var(--primary); }
.booking-day.is-selected { border-color: var(--primary); background: var(--primary); color: #fff; }
.booking-day.is-selected span, .booking-day.is-selected small { color: rgba(255,255,255,.85); }
.booking-time-panel { display: grid; gap: .7rem; }
.booking-time-heading { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.booking-time-heading span { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; font-weight: 700; }
.booking-time-heading strong { font-size: .95rem; color: var(--primaryDark); }
.booking-time-group { margin-bottom: .5rem; }
.booking-time-group > span { display: block; font-size: .78rem; color: var(--muted); margin-bottom: .35rem; font-weight: 700; }
.booking-time-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.3rem, 1fr)); gap: .5rem; }
.booking-time { padding: .6rem .3rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .12s, background .12s; }
.booking-time:hover { border-color: var(--primary); }
.booking-time.is-selected { border-color: var(--primary); background: var(--primary); color: #fff; }
.booking-next { margin-top: 1rem; }

/* form */
.lead-form { display: grid; gap: 1rem; margin-top: .5rem; }
.lead-form > label { display: grid; gap: .35rem; font-weight: 700; font-size: .9rem; }
.lead-form input, .lead-form select {
  padding: .85rem .9rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.lead-form input:focus, .lead-form select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.phone-grid { display: grid; grid-template-columns: minmax(8rem, .8fr) 1fr; gap: .6rem; }
.consents { display: grid; gap: .2rem; }
.consent-row { display: grid; grid-template-columns: 1.3rem 1fr; gap: .6rem; align-items: start; font-weight: 400; padding: .35rem 0; }
.consent-row input { width: 1.3rem; height: 1.3rem; margin-top: .1rem; accent-color: var(--primary); cursor: pointer; }
.consent-row label { font-size: .82rem; color: var(--muted); line-height: 1.4; cursor: pointer; }
.consent-all { padding: .7rem .85rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--soft); }
.consent-all label { font-size: .92rem; color: var(--text); }
.consent-all label strong { font-weight: 700; }
.consent-group { display: grid; gap: .1rem; padding: .2rem 0 .1rem .4rem; border-left: 2px solid var(--soft); margin-left: .4rem; }
.consent-note { margin: .3rem 0 0; font-size: .76rem; color: var(--muted); font-weight: 600; }
.legal-note { font-size: .74rem; color: var(--muted); line-height: 1.45; margin: 0; }
.form-error { margin: 0; padding: .7rem .9rem; border-radius: 10px; background: #fdecec; color: #a32626; font-size: .88rem; font-weight: 600; }

/* success */
.success-card { display: flex; gap: 1.1rem; align-items: center; padding: 1rem; }
.success-avatar { width: 4rem; height: 4rem; border-radius: 50%; object-fit: cover; object-position: 50% 16%; border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--primary); flex: 0 0 auto; }
.success-card strong { display: block; font-size: 1.2rem; margin-bottom: .35rem; color: var(--primaryDark); }
.success-card p { margin: 0; color: var(--muted); }

/* responsive */
@media (max-width: 560px) {
  .options-area.answer-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .phone-grid { grid-template-columns: 1fr; }
  .parent-note { display: none; }
  .conversation { gap: .75rem; }
}
