/* ============================================================
   diagnosis.css — page-specific layout for diagnosis.html
   All colors aligned to tokens in global.css.
   No CSS vars redeclared here.
   ============================================================ */

html { height: 100%; }
body {
  min-height: 100%;
  background: var(--bg);
}

/* ============================================================
   PROGRESS BAR — sits under the shared 58px nav
   ============================================================ */
#prog-track {
  position: fixed;
  top: var(--nav-h);   /* offset for shared nav */
  left: 0;
  right: 0;
  height: 1px;
  background: var(--bg3);
  z-index: 100;
}
#prog-fill {
  height: 100%;
  background: var(--text);
  width: 0;
  transition: width .6s cubic-bezier(.4, 0, .2, 1);
}

/* ============================================================
   BOTTOM-LEFT NAV
   #homebtn — always visible, returns to index.html
   #backbtn — only visible mid-flow; stacks above #homebtn
   ============================================================ */
#homebtn {
  position: fixed;
  bottom: 28px;
  left: 40px;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: color .2s;
  z-index: 100;
}
#homebtn:hover     { color: var(--text); }
#homebtn.hidden    { display: none; }

#backbtn {
  position: fixed;
  bottom: 56px;          /* stacks above #homebtn */
  left: 40px;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  transition: color .2s;
  display: none;
  z-index: 100;
}
#backbtn:hover { color: var(--text2); }
#backbtn.on    { display: block; }

/* ============================================================
   APP CONTAINER + SCREENS
   Rule 6: min-height uses 100dvh, never 100vh.
   ============================================================ */
#app {
  position: relative;
  min-height: 100dvh;
}

.screen {
  display: none;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 80px;
  flex-direction: column;
}
.screen.show {
  display: flex;
  animation: fadeUp .4s ease forwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Page-scoped inner — overrides the global .inner */
.screen .inner {
  width: 100%;
  max-width: 660px;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 22px;
}
.headline {
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.1;
  text-align: center;
  margin-bottom: 16px;
}
.subtext {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text2);
  text-align: center;
  max-width: 420px;
  margin-bottom: 44px;
}
.q-title {
  font-size: clamp(20px, 3.5vw, 34px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  text-align: center;
  margin-bottom: 10px;
}
.q-sub {
  font-size: 13px;
  color: var(--text3);
  text-align: center;
  margin-bottom: 36px;
  letter-spacing: .02em;
}

/* ============================================================
   SUB-STEP TRACKER (Step 3 only)
   Deliberately small + dim so it sits below the main "Step N of 5"
   eyebrow without competing with it visually.
   ============================================================ */
.substep-track {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: -10px 0 22px;
}
.substep-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-md);
  transition: background .25s ease;
}
.substep-dot.on {
  background: var(--text2);
}

/* ============================================================
   BUTTONS — page-scoped override of global .btn / .btn-g
   These match the diagnosis aesthetic: square, uppercase, letterspaced.
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--text);
  color: var(--bg);
  border: none;
  padding: 16px 36px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, transform .15s;
  text-decoration: none;
  border-radius: 0;
}
.btn:hover  { background: #f0f0f0; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-o {
  background: transparent;
  color: var(--text3);
  border: 1px solid var(--border-md);
  padding: 14px 28px;
}
.btn-o:hover {
  border-color: var(--border-hi);
  color: var(--text);
  background: transparent;
}

/* ============================================================
   CARD GRID (s2 — symptoms)
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  margin-bottom: 32px;
}
.card {
  border: 1px solid var(--border-md);
  padding: 18px 16px;
  cursor: pointer;
  transition: border-color .18s, background .18s;
  text-align: left;
  position: relative;
  background: transparent;
}
.card:hover { border-color: var(--border-hi); }
.card.on {
  border-color: rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .05);
}
.card.on::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text);
}
.card-t {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}
.card-s {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
  line-height: 1.4;
}

/* ============================================================
   ROW LIST (s3 sub-questions, s4 goal list)
   ============================================================ */
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-bottom: 32px;
}
.row {
  border: 1px solid var(--border-md);
  padding: 20px 22px;
  cursor: pointer;
  transition: border-color .18s, background .18s;
  text-align: left;
  background: transparent;
  width: 100%;
  font-family: inherit;
  color: inherit;
}
.row:hover {
  border-color: var(--border-hi);
  background: rgba(255, 255, 255, .02);
}
.row.on {
  border-color: rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .05);
}
.row-t {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.row-s {
  font-size: 12px;
  color: var(--text3);
  margin-top: 3px;
}

/* ============================================================
   FORM FIELDS (s1 profile, modal email)
   ============================================================ */
.fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin-bottom: 32px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text3);
  font-weight: 500;
}
.field input {
  background: transparent;
  border: 1px solid var(--border-md);
  padding: 14px 16px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
  -webkit-appearance: none;
  border-radius: 0;
}
.field input::placeholder { color: var(--bg3); }
.field input:focus        { border-color: var(--border-hi); }

/* ============================================================
   SCAN ANIMATION (s5)
   ============================================================ */
.scan {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.scan-track {
  width: 240px;
  height: 1px;
  background: var(--bg3);
  overflow: hidden;
  position: relative;
}
.scan-fill {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: var(--text);
  animation: sweep 1.3s ease-in-out infinite;
}
@keyframes sweep { to { left: 140%; } }

.scan-lbl {
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text3);
  animation: blink 1.3s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: .3; }
  50%      { opacity: 1; }
}

/* ============================================================
   RESULT SCREEN (s6)
   ============================================================ */
.dx-box {
  width: 100%;
  border: 1px solid var(--border-md);
  padding: 36px 32px;
  text-align: center;
  margin-bottom: 14px;
}
.dx-eye {
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 18px;
}
.dx-name {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -.025em;
  margin-bottom: 12px;
  line-height: 1.05;
}
.dx-stmt {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.65;
  max-width: 440px;
  margin: 0 auto 24px;
}

.sev {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.sev-lbl {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text3);
}
.sev-track {
  width: 110px;
  height: 2px;
  background: var(--bg3);
}
.sev-fill {
  height: 100%;
  background: var(--text);
  width: 0;
  transition: width 1s cubic-bezier(.4, 0, .2, 1) .4s;
}
.sev-val {
  font-size: 12px;
  font-weight: 700;
  min-width: 32px;
}

.finds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  margin-bottom: 14px;
}
.find {
  border: 1px solid var(--border);
  padding: 18px 16px;
}
.find-n {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 8px;
}
.find-t {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
  line-height: 1.3;
}
.find-d {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.5;
}

.rx-sec { width: 100%; margin-bottom: 28px; }
.rx-lbl {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 16px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.rx-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rx-card {
  border: 1px solid var(--border-md);
  padding: 22px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.rx-card.rec {
  border-color: var(--text);
  background: rgba(255, 255, 255, .04);
}
.rx-tier {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 5px;
}
.rx-card.rec .rx-tier { color: var(--text2); }
.rx-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.rx-desc {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.5;
}
.rec-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--text);
  color: var(--bg);
  padding: 5px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.cta-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.cta-note {
  margin-top: 14px;
  font-size: 11px;
  color: var(--text3);
  text-align: center;
}
.cta-note a {
  color: var(--text2);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border-md);
  transition: color .2s, text-decoration-color .2s;
}
.cta-note a:hover {
  color: var(--text);
  text-decoration-color: var(--text2);
}

/* Partner mention beneath the Rx cards — slightly more present than
   .cta-note since it continues the recommendation thread. */
.rx-partner {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text3);
  line-height: 1.65;
  text-align: center;
}
.rx-partner a {
  color: var(--text2);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border-md);
  transition: color .2s, text-decoration-color .2s;
}
.rx-partner a:hover {
  color: var(--text);
  text-decoration-color: var(--text2);
}

/* ============================================================
   MODAL — report capture
   ============================================================ */
#modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 24px;
}
#modal.on {
  display: flex;
  animation: fadeUp .3s ease;
}
.mbox {
  background: var(--bg3);
  border: 1px solid var(--border-md);
  padding: 36px;
  max-width: 420px;
  width: 100%;
  position: relative;
}
.mbox-t {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.mbox-s {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 24px;
  line-height: 1.6;
}
.mclose {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 22px;
  cursor: pointer;
  font-family: inherit;
}
.mclose:hover { color: var(--text2); }
.mrow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
#mcopy-msg {
  display: none;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text3);
  text-align: center;
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .finds { grid-template-columns: 1fr; }
  #backbtn,
  #homebtn { left: 24px; }
}

/* ============================================================
   REDUCED MOTION — kill non-essential keyframes; keep readable
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .screen.show { animation: none; }
  .scan-fill   { animation: none; left: 0; width: 100%; }
  .scan-lbl    { animation: none; opacity: 1; }
  #modal.on    { animation: none; }
  #prog-fill,
  .sev-fill    { transition: none; }
}
