/* ============================================================
   Life Domination — Health Assessment
   Design language: "Clinical-premium dark"
   (near-black navy · gold accent · Inter · data-forward)
   ============================================================ */

:root {
  --bg:        #0a0f1a;
  --card:      #111827;
  --card2:     #0f1623;
  --card3:     #0c1320;
  --line:      #1f2a3a;
  --line2:     #2a384c;
  --gold:      #c9a84c;
  --gold-soft: #e0c578;
  --text:      #f9fafb;
  --text2:     #d7dbe3;
  --muted:     #8b93a3;
  --muted2:    #6b7280;

  --sev:   #ef4444;  /* Priority  */
  --mod:   #f59e0b;  /* Elevated  */
  --mild:  #3b82f6;  /* Mild      */
  --clear: #22c55e;  /* Clear     */

  --radius:    16px;
  --radius-sm: 11px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

.hidden { display: none !important; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); border:0; }

/* ---------- App shell ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 5vw, 40px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  background: rgba(10,15,26,0.86);
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 16px; letter-spacing: .3px; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: var(--gold); color: #1a1306; font-size: 15px;
}
.topbar .who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }

main { flex: 1; width: 100%; }
.container { max-width: 860px; margin: 0 auto; padding: clamp(20px, 4vw, 40px) clamp(16px, 5vw, 28px) 64px; }
.container-narrow { max-width: 560px; }

/* ---------- Centered auth ---------- */
.center-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: clamp(20px,5vw,48px); }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px);
  position: relative; overflow: hidden;
  width: 100%;
}
.card.accent::before { content:""; position:absolute; inset:0 0 auto 0; height:3px; background: var(--gold); }

/* ---------- Type ---------- */
.eyebrow { text-transform: uppercase; letter-spacing: 2.5px; font-size: 11px; font-weight: 600; color: var(--gold); margin: 0 0 12px; }
h1.display { font-weight: 700; font-size: clamp(26px, 5vw, 36px); line-height: 1.08; margin: 0 0 12px; letter-spacing: -.4px; }
.lede { font-size: 16px; color: var(--text2); margin: 0 0 24px; max-width: 52ch; }
.section-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.6px; color: var(--muted); margin: 30px 0 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: none; cursor: pointer; font-family: var(--sans); font-size: 15.5px; font-weight: 600;
  padding: 14px 22px; border-radius: var(--radius-sm);
  transition: transform .12s ease, background .2s ease, opacity .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-block { width: 100%; }
.btn-primary { background: var(--gold); color: #1a1306; }
.btn-primary:hover { background: var(--gold-soft); }
.btn-dark { background: #1b2433; color: var(--text); border: 1px solid var(--line2); }
.btn-dark:hover { background: #222d40; }
.btn-google { background: #fff; color: #3c4043; }
.btn-google:hover { background: #f1f3f4; }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--line2); padding: 11px 18px; font-size: 14px; }
.btn-ghost:hover { background: #161f2e; }
.btn-lg { padding: 16px 26px; font-size: 16px; }

/* ---------- Divider ---------- */
.divider { display:flex; align-items:center; gap:14px; color: var(--muted2); font-size: 13px; margin: 22px 0; }
.divider::before, .divider::after { content:""; height:1px; flex:1; background: var(--line); }

/* ---------- Form fields ---------- */
.field { margin-bottom: 16px; }
.field label { display:block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.field input, .field select {
  width: 100%; padding: 13px 14px; font-size: 16px; font-family: var(--sans);
  background: var(--card2); color: var(--text);
  border: 1px solid var(--line2); border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,.18); }
.field .hint { font-size: 12.5px; color: var(--muted2); margin-top: 6px; }

.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice {
  flex: 1 1 auto; min-width: 110px; text-align: center;
  padding: 13px 14px; border-radius: var(--radius-sm); cursor: pointer;
  background: var(--card2); border: 1px solid var(--line2); color: var(--text2);
  font-size: 15px; font-weight: 500; transition: all .14s ease;
}
.choice:hover { border-color: var(--muted); }
.choice.selected { border-color: var(--gold); background: rgba(201,168,76,.12); color: var(--gold-soft); }

/* ---------- Notices ---------- */
.notice { border-radius: var(--radius-sm); padding: 13px 15px; font-size: 14px; margin-top: 16px; display: none; }
.notice.show { display: block; }
.notice.ok  { background: rgba(34,197,94,.12);  color: #86efac; border: 1px solid rgba(34,197,94,.3); }
.notice.err { background: rgba(239,68,68,.12);  color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }
.notice.info{ background: rgba(59,130,246,.12); color: #93c5fd; border: 1px solid rgba(59,130,246,.3); }

.fineprint { font-size: 12.5px; color: var(--muted2); margin-top: 20px; text-align: center; line-height: 1.55; }

/* ---------- Dashboard tiles ---------- */
.tile { display:flex; gap:15px; align-items:flex-start; background: var(--card2); border:1px solid var(--line); border-radius: var(--radius-sm); padding: 17px 19px; margin-top: 16px; }
.tile .ic { flex:none; width:38px; height:38px; border-radius:9px; background: rgba(201,168,76,.13); display:grid; place-items:center; color: var(--gold); }
.tile h3 { margin:1px 0 4px; font-size:15px; color: var(--text); }
.tile p { margin:0; font-size:13.5px; color: var(--muted); }

/* ---------- Progress bar (assessment) ---------- */
.progress-head { position: sticky; top: 67px; z-index: 15; background: var(--bg); padding: 16px 0 12px; }
.progress-meta { display:flex; justify-content:space-between; align-items:baseline; font-size:13px; color: var(--muted); margin-bottom: 8px; }
.progress-meta .step-name { color: var(--text); font-weight: 600; font-size: 14px; }
.progress-track { height: 7px; background: #16202f; border-radius: 7px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--gold); border-radius: 7px; width: 0%; transition: width .3s ease; }

/* ---------- Symptom rows ---------- */
.step-intro { font-size: 14.5px; color: var(--muted); margin: 4px 0 18px; }
.symptom {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 15px 16px; margin-bottom: 12px;
}
.symptom.answered { border-color: var(--line2); }
.symptom .q { font-size: 15px; color: var(--text); margin-bottom: 12px; }
.rating { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rating button {
  border: 1px solid var(--line2); background: var(--card2); color: var(--text2);
  border-radius: 9px; padding: 9px 4px; cursor: pointer; font-family: var(--sans);
  font-size: 13px; font-weight: 600; line-height: 1.2; transition: all .13s ease;
  display: flex; flex-direction: column; gap: 3px; align-items: center;
}
.rating button .n { font-size: 11px; font-weight: 600; color: var(--muted2); }
.rating button:hover { border-color: var(--muted); }
.rating button.sel { border-color: var(--gold); background: rgba(201,168,76,.14); color: var(--gold-soft); }
.rating button.sel .n { color: var(--gold); }

/* ---------- Sticky nav footer (assessment) ---------- */
.step-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.step-nav .btn { flex: 1; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 22px 20px 30px; text-align: center; font-size: 12px; color: var(--muted2); line-height: 1.6; }
.foot strong { color: var(--text2); }

/* ---------- Loading splash / spinner ---------- */
.splash { position: fixed; inset: 0; display:grid; place-items:center; background: var(--bg); z-index: 50; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--gold); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.processing { text-align: center; padding: 60px 20px; }
.processing .spinner { margin: 0 auto 22px; }
.processing h2 { font-weight: 700; font-size: 22px; margin: 0 0 8px; }
.processing p { color: var(--muted); margin: 0; }

/* ---------- Avatar ---------- */
.avatar { width: 50px; height: 50px; border-radius: 50%; background: #1b2433; color: var(--gold); display:grid; place-items:center; font-size: 20px; font-weight: 700; overflow:hidden; flex:none; }
.avatar img { width:100%; height:100%; object-fit: cover; }
.welcome-row { display:flex; align-items:center; gap:15px; margin-bottom: 4px; }

@media (max-width: 430px) {
  .rating button { font-size: 12px; padding: 9px 2px; }
  .choice { min-width: 0; flex-basis: calc(50% - 5px); }
}
