/* =====================================================================
   Homebuyer Readiness Funnel — visual system
   Inspired by the "Moonshot AI UI Kit" aesthetic:
   soft pastel mesh gradients, floating white cards, pill buttons,
   mint-green success accent, DM Sans typography.
   ===================================================================== */

:root {
  /* type */
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* ink + surfaces */
  --ink:        #1d2638;
  --ink-soft:   #4a5468;
  --muted:      #8a93a6;
  --faint:      #b7c0d0;
  --card:       #ffffff;
  --line:       #e6eaf2;
  --line-soft:  #f1f4f9;
  --tint:       #f3f6fb;

  /* blue palette (trust / finance) + green-mint success */
  --lav:   #4d82ef;   /* primary accent (eyebrow, links) */
  --lav-2: #7aa6f5;   /* hover / focus borders */
  --pink:  #2f6fe0;   /* selected ring (primary blue) */
  --pink-2:#9cc2fb;
  --peach: #38b0dd;   /* cyan accent */
  --peach-2:#bfe8f2;
  --mint:  #34b074;
  --mint-deep: #1f8a5b;

  /* gradients */
  --grad-orb:
    radial-gradient(at 32% 28%, #7aa8f5 0, transparent 56%),
    radial-gradient(at 72% 32%, #6fd2e8 0, transparent 56%),
    radial-gradient(at 62% 78%, #8fb8ff 0, transparent 56%),
    radial-gradient(at 24% 72%, #6f7ef0 0, transparent 56%),
    #cfe0fb;
  --grad-cta:   linear-gradient(100deg, #2f6fe0 0%, #3d83ec 55%, #38b0dd 100%);
  --grad-cta-2: linear-gradient(100deg, #2f6fe0 0%, #4d8bee 50%, #38b0dd 100%);
  --grad-bar:   linear-gradient(90deg, #5b8def, #3d83ec 55%, #38b0dd);

  --shadow-card: 0 30px 70px -38px rgba(30, 60, 120, .42),
                 0 6px 18px -10px rgba(30, 60, 120, .16);
  --shadow-pill: 0 12px 26px -12px rgba(45, 111, 219, .5);
  --r-lg: 32px;
  --r-md: 20px;
  --r-sm: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  min-height: 100%;
  background:
    radial-gradient(at 18% 14%, #dde9fb 0, transparent 48%),
    radial-gradient(at 84% 12%, #d8f0fa 0, transparent 46%),
    radial-gradient(at 80% 82%, #dfe9fc 0, transparent 50%),
    radial-gradient(at 12% 80%, #e4edfd 0, transparent 50%),
    #eef3fa;
  background-attachment: fixed;
}

/* ----------------------------------------------------------------- app shell */
.app {
  position: relative;
  width: 100%;
  max-width: 446px;
  min-height: min(840px, 94vh);
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 14px;
  flex-shrink: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -.01em;
  color: var(--ink);
}
.brand .mark {
  width: 26px; height: 26px;
  border-radius: 9px;
  background: var(--grad-orb);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.5);
  flex-shrink: 0;
}
.brand .mark.spin { animation: breathe 9s ease-in-out infinite; }

.lang {
  display: inline-flex;
  background: var(--tint);
  border-radius: 999px;
  padding: 3px;
  border: 1px solid var(--line);
}
.lang button {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: .2s;
  letter-spacing: .02em;
}
.lang button.on {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 6px -2px rgba(80,60,120,.25);
}

/* progress */
.progress {
  padding: 0 24px 4px;
  flex-shrink: 0;
  opacity: 1;
  transition: opacity .3s, height .3s;
}
.progress.hide { opacity: 0; height: 0; padding: 0 24px; pointer-events: none; }
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.track {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--grad-bar);
  transition: width .45s cubic-bezier(.4,0,.1,1);
}

/* ----------------------------------------------------------------- screen */
.screen-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 24px 24px;
  overflow-y: auto;
}
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: rise .42s cubic-bezier(.2,.7,.2,1) both;
}

/* ----------------------------------------------------------------- welcome */
.welcome { align-items: center; text-align: center; justify-content: center; gap: 4px; }
.orb {
  width: 168px; height: 168px;
  border-radius: 50%;
  background: var(--grad-orb);
  box-shadow: 0 24px 50px -22px rgba(150,120,200,.6),
              inset 0 0 30px rgba(255,255,255,.35);
  margin: 6px auto 26px;
  animation: breathe 8s ease-in-out infinite;
}
.orb.sm { width: 96px; height: 96px; margin: 0 auto 18px; }

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lav);
  margin-bottom: 14px;
}
h1.head {
  font-size: 31px;
  line-height: 1.12;
  letter-spacing: -.02em;
  font-weight: 600;
  color: var(--ink);
  text-wrap: balance;
  margin-bottom: 14px;
}
h1.head .grad {
  background: linear-gradient(100deg, #2f6fe0, #3a9ad8 60%, #36bcc8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sub {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 330px;
  margin: 0 auto;
  text-wrap: pretty;
}
.welcome .sub { margin-bottom: 30px; }

.trust {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.trust span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
}
.trust svg { width: 15px; height: 15px; color: var(--mint-deep); }

/* ----------------------------------------------------------------- question */
.q-head { margin-bottom: 20px; }
.q-title {
  font-size: 23px;
  line-height: 1.22;
  letter-spacing: -.015em;
  font-weight: 600;
  color: var(--ink);
  text-wrap: pretty;
}
.q-sub {
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.45;
}

.options { display: flex; flex-direction: column; gap: 10px; }
.opt {
  font-family: var(--font);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 16px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: transform .12s, border-color .18s, background .18s, box-shadow .18s;
}
.opt:hover { border-color: var(--lav-2); transform: translateY(-1px); }
.opt:active { transform: translateY(0) scale(.99); }
.opt .dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--faint);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: .18s;
}
.opt .dot svg { width: 12px; height: 12px; color: #fff; opacity: 0; transform: scale(.5); transition: .2s; }
.opt.sel {
  border-color: transparent;
  background: linear-gradient(100deg, #eef4fe, #eef6fd 55%, #f0f9fd);
  box-shadow: 0 0 0 1.5px var(--pink), 0 10px 22px -16px rgba(45,111,219,.32);
}
.opt.sel .dot { background: var(--grad-cta-2); border-color: transparent; }
.opt.sel .dot svg { opacity: 1; transform: scale(1); }

/* select + text inputs */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 4px; }
.field label {
  font-size: 13px; font-weight: 600; color: var(--ink-soft); letter-spacing: -.005em;
}
.control {
  font-family: var(--font);
  width: 100%;
  padding: 15px 16px;
  font-size: 15px;
  color: var(--ink);
  background: var(--tint);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  transition: .18s;
  appearance: none;
}
.control::placeholder { color: var(--faint); }
.control:focus {
  outline: none;
  background: #fff;
  border-color: var(--lav-2);
  box-shadow: 0 0 0 4px rgba(185,177,240,.18);
}
select.control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%239794a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}
.field.err .control { border-color: #e98aa8; background: #fdf3f6; }
.err-msg { font-size: 12px; color: #d96d8e; font-weight: 500; display: none; }
.field.err .err-msg { display: block; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .field.full { grid-column: 1 / -1; }
.form-stack { display: flex; flex-direction: column; gap: 13px; }

/* ----------------------------------------------------------------- footer / cta */
.footer {
  flex-shrink: 0;
  padding: 14px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.btn {
  font-family: var(--font);
  position: relative;
  width: 100%;
  border: 0;
  padding: 17px 22px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: #ffffff;
  background: var(--grad-cta);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-pill);
  transition: transform .14s, box-shadow .2s, filter .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.btn:hover { transform: translateY(-2px); filter: saturate(1.06) brightness(1.03); box-shadow: 0 18px 34px -14px rgba(45,111,219,.6); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; filter: grayscale(.2); }
.btn svg { width: 18px; height: 18px; }
.btn.ghost {
  background: var(--tint);
  color: var(--ink-soft);
  box-shadow: none;
  border: 1.5px solid var(--line);
}
.btn.ghost:hover { filter: none; background: #f0eef6; }

.nav-row { display: flex; gap: 10px; align-items: center; }
.back-btn {
  font-family: var(--font);
  flex-shrink: 0;
  width: 54px; height: 54px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--tint);
  color: var(--ink-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: .16s;
}
.back-btn:hover { background: #f0eef6; transform: translateX(-2px); }
.back-btn svg { width: 19px; height: 19px; }
.nav-row .btn { flex: 1; }

.fineprint {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
  padding: 0 6px;
}
.fineprint a { color: var(--lav); text-decoration: none; font-weight: 600; }

/* ----------------------------------------------------------------- gate (teaser) */
.gate { text-align: center; }
.score-teaser {
  position: relative;
  margin: 4px auto 22px;
  width: 150px; height: 150px;
}
.locked-ring {
  width: 150px; height: 150px;
  border-radius: 50%;
  background: var(--grad-orb);
  filter: blur(7px);
  opacity: .85;
}
.lock-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.lock-badge .pill {
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(4px);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 7px;
  box-shadow: 0 6px 16px -8px rgba(80,60,120,.4);
}
.lock-badge svg { width: 14px; height: 14px; color: var(--lav); }

.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  margin: 2px auto 0;
}
.privacy-note svg { width: 14px; height: 14px; color: var(--mint-deep); }

/* ----------------------------------------------------------------- result */
.result { align-items: center; text-align: center; }
.ring-wrap { position: relative; width: 200px; height: 200px; margin: 4px auto 6px; }
.ring-wrap svg { width: 200px; height: 200px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 14; }
.ring-fg {
  fill: none;
  stroke: var(--cat, #2f6fe0);
  stroke-width: 14;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.3s cubic-bezier(.3,.7,.2,1);
}
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-num {
  font-size: 52px; font-weight: 600; letter-spacing: -.03em; line-height: 1;
  color: var(--cat, #2f6fe0);
}
.ring-num small { font-size: 20px; color: var(--faint); }
.ring-label { font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  margin: 14px auto 16px;
}
/* traffic-light result categories */
.cat-hot    { background: linear-gradient(100deg,#d6f1e1,#c4ead3); color: #1f8a5b; }
.cat-warm   { background: linear-gradient(100deg,#fbf0cb,#f7e6b0); color: #ab8210; }
.cat-nurture{ background: linear-gradient(100deg,#fde5cf,#fbd6b6); color: #c5602a; }
.cat-long   { background: linear-gradient(100deg,#fadbd3,#f6c7bb); color: #c0392b; }
.cat-badge .emo { font-size: 16px; }

.result .blurb {
  font-size: 15px; line-height: 1.6; color: var(--ink-soft);
  max-width: 340px; margin: 0 auto 22px; text-wrap: pretty;
}

.actions {
  width: 100%;
  text-align: left;
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 6px;
}
.actions h3 {
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 2px;
}
.action {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 15px;
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.action .ic {
  width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--grad-orb);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.4);
}
.action .ic svg { width: 17px; height: 17px; color: #fff; }
.action .txt b { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.action .txt span { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* appointment card */
.appt {
  width: 100%;
  margin-top: 22px;
  padding: 22px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #e9f1fd 0%, #e5f4fb 50%, #edf3fd 100%);
  border: 1px solid #dde9fb;
  text-align: center;
}
.appt h3 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); margin-bottom: 7px; }
.appt p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; margin-bottom: 16px; }

.restart {
  font-family: var(--font);
  background: none; border: 0; cursor: pointer;
  color: var(--muted); font-size: 13px; font-weight: 500;
  margin: 18px auto 4px; padding: 6px;
  text-decoration: underline; text-underline-offset: 3px;
}
.restart:hover { color: var(--ink-soft); }

/* ----------------------------------------------------------------- anims */
@keyframes rise {
  from { transform: translateY(13px); }
  to   { transform: translateY(0); }
}
@keyframes breathe {
  0%,100% { transform: scale(1) rotate(0deg); }
  50%     { transform: scale(1.05) rotate(8deg); }
}
@keyframes pop {
  0%   { transform: scale(.82); }
  60%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}
.pop { animation: pop .6s cubic-bezier(.2,.8,.2,1) both; }

@media (prefers-reduced-motion: reduce) {
  *, .screen, .orb, .brand .mark.spin, .pop { animation: none !important; transition: none !important; }
}

/* small screens */
@media (max-height: 720px) {
  .app { min-height: 0; }
}
@media (max-width: 470px) {
  body { padding: 0; }
  .app { border-radius: 0; min-height: 100vh; min-height: 100dvh; max-width: 100%; box-shadow: none; }
}
