/* Tesray Operations Gap Analysis */

:root {
  --gold: #C5A55A;
  --gold-light: #D4BA78;
  --gold-dark: #A8893E;
  --ink: #0E0E1C;
  --ink-2: #1A1A2E;
  --ink-3: #23233D;
  --line: rgba(255,255,255,0.10);
  --line-2: rgba(255,255,255,0.18);
  --fg: #EFEEF4;
  --fg-dim: #A5A4B8;
  --fg-faint: #74738A;
  --good: #4FB286;
  --ok: #7FA8D9;
  --warn: #D9A441;
  --bad: #D4655C;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 14px;
  --pad: 44px;
}

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

body {
  font-family: var(--font);
  background: var(--ink);
  background-image:
    radial-gradient(900px 500px at 12% -8%, rgba(197,165,90,0.13), transparent 60%),
    radial-gradient(800px 600px at 92% 4%, rgba(80,90,180,0.14), transparent 62%);
  background-attachment: fixed;
  color: var(--fg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 140px;
}

/* ------------------------------------------------------------- chrome */

.brandbar { text-align: center; padding: 32px 20px 8px; }
.wordmark {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.wordmark span { color: var(--fg-faint); font-weight: 500; }

.shell { max-width: 780px; margin: 0 auto; padding: 18px 20px 0; }

.card {
  background: linear-gradient(180deg, rgba(35,35,61,0.92) 0%, rgba(26,26,46,0.92) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--pad);
  box-shadow: 0 24px 70px rgba(0,0,0,0.45);
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px; height: 1px;
  background: var(--gold);
  vertical-align: middle;
  margin-right: 10px;
}

h1 { font-size: 34px; line-height: 1.22; font-weight: 800; letter-spacing: -0.02em; }
h1 em { font-style: normal; color: var(--gold); }
h2.q-text { font-size: 25px; line-height: 1.32; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }

.lede { color: var(--fg-dim); font-size: 16px; margin-top: 16px; }
.sub { color: var(--fg-dim); font-size: 14px; margin-top: 10px; }
.aside { color: var(--fg-dim); font-size: 14px; margin-top: 12px; }
.meta-line { color: var(--fg-faint); font-size: 13px; margin-top: 22px; }

/* --------------------------------------------------------------- intro */

.intro-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 26px;
}
.intro-stage { background: rgba(14,14,28,0.6); padding: 16px 18px; }
.intro-stage-name { font-weight: 700; font-size: 14px; color: var(--gold-light); }
.intro-stage-q { font-size: 13px; color: var(--fg-dim); line-height: 1.5; margin-top: 3px; }

.intro-note {
  margin-top: 24px;
  padding: 16px 18px;
  border-left: 2px solid var(--gold);
  background: rgba(197,165,90,0.07);
  font-size: 14px;
  color: var(--fg-dim);
  border-radius: 0 8px 8px 0;
}
.intro-note strong { color: var(--fg); }

/* ------------------------------------------------------------- options */

.options { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--fg);
  background: rgba(14,14,28,0.5);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 17px 20px;
  cursor: pointer;
  transition: border-color .16s, background .16s, transform .1s;
}
.option:hover { border-color: var(--gold); background: rgba(197,165,90,0.09); }
.option:active { transform: scale(0.995); }
.option.selected { border-color: var(--gold); background: rgba(197,165,90,0.15); }
.option-num { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; min-width: 14px; }
.option-unsure { color: var(--fg-dim); font-size: 15px; margin-top: 4px; }

/* -------------------------------------------------------------- fields */

.fields { margin-top: 26px; display: flex; flex-direction: column; gap: 18px; }
.fields-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 14px; color: var(--fg-dim); line-height: 1.45; }

.input-wrap { display: flex; align-items: center; gap: 8px; }
.affix { color: var(--fg-faint); font-size: 14px; white-space: nowrap; }
.affix-right { flex-shrink: 0; }

.field input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 16px;
  color: var(--fg);
  background: rgba(14,14,28,0.6);
  border: 1px solid var(--line-2);
  border-radius: 9px;
  padding: 12px 14px;
  transition: border-color .16s;
}
.field input:focus { outline: none; border-color: var(--gold); }

.privacy {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 13px;
  color: var(--fg-dim);
  background: rgba(14,14,28,0.4);
}

/* -------------------------------------------------------------- footer */

#footer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: stretch;
  max-width: 780px;
  margin: 0 auto 18px;
  background: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,0.55);
}
@media (min-width: 820px) { #footer { left: 20px; right: 20px; } }

.nav {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border: 0;
  padding: 18px 24px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s, opacity .16s;
}
.nav-back { background: transparent; color: var(--fg-dim); }
.nav-back:hover:not(:disabled) { background: rgba(255,255,255,0.05); color: var(--fg); }
.nav-next { background: var(--gold); color: #14141F; }
.nav-next:hover:not(:disabled) { background: var(--gold-light); }
.nav:disabled { opacity: 0.32; cursor: not-allowed; }

.progress { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; background: rgba(14,14,28,0.6); }
.progress-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(197,165,90,0.22); transition: width .3s ease; }
.progress-pct { position: relative; font-size: 13px; font-weight: 600; color: var(--fg-dim); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- results */

.card-results { padding-bottom: 34px; }
.rsec { padding-top: 34px; margin-top: 34px; border-top: 1px solid var(--line); }
.rsec:first-child { padding-top: 0; margin-top: 0; border-top: 0; }

.result-headline { font-size: 30px; line-height: 1.24; }

.score-row { display: flex; align-items: flex-start; gap: 26px; margin-top: 6px; }
.score-big { display: flex; align-items: baseline; }
.score-num { font-size: 68px; font-weight: 800; line-height: 1; color: var(--gold); letter-spacing: -0.03em; }
.score-den { font-size: 20px; color: var(--fg-faint); font-weight: 600; }
.score-text { flex: 1; }
.score-band { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.score-text p { color: var(--fg-dim); font-size: 14px; }

.gauge { margin-top: 24px; position: relative; }
.gauge-track { display: flex; height: 8px; border-radius: 4px; overflow: hidden; }
.gauge-seg { height: 100%; }
.gauge-seg-0 { background: rgba(212,101,92,0.75); }
.gauge-seg-1 { background: rgba(217,164,65,0.7); }
.gauge-seg-2 { background: rgba(217,164,65,0.5); }
.gauge-seg-3 { background: rgba(127,168,217,0.6); }
.gauge-seg-4 { background: rgba(79,178,134,0.7); }
.gauge-marker {
  position: absolute; top: -5px;
  width: 3px; height: 18px;
  background: #fff; border-radius: 2px;
  transform: translateX(-50%);
  box-shadow: 0 0 0 3px rgba(14,14,28,0.85);
}
.gauge-labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--fg-faint); }

.bar-row { margin-top: 20px; }
.bar-row:first-of-type { margin-top: 4px; }
.bar-binding { padding: 16px 18px; margin-left: -18px; margin-right: -18px; background: rgba(197,165,90,0.08); border-left: 2px solid var(--gold); border-radius: 0 8px 8px 0; }
.bar-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.bar-name { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.bar-right { display: flex; align-items: center; gap: 10px; }
.bar-score { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--fg-dim); font-weight: 600; }
.bar-q { font-size: 13px; color: var(--fg-faint); margin-top: 7px; }

.track { height: 7px; background: rgba(255,255,255,0.07); border-radius: 4px; margin-top: 9px; overflow: hidden; }
.fill { height: 100%; border-radius: 4px; }
.fill-good { background: var(--good); }
.fill-ok   { background: var(--ok); }
.fill-warn { background: var(--warn); }
.fill-bad  { background: var(--bad); }

.chip { font-size: 10px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; padding: 4px 9px; border-radius: 20px; white-space: nowrap; }
.chip-good { background: rgba(79,178,134,0.16); color: var(--good); }
.chip-ok   { background: rgba(127,168,217,0.16); color: var(--ok); }
.chip-warn { background: rgba(217,164,65,0.16); color: var(--warn); }
.chip-bad  { background: rgba(212,101,92,0.16); color: var(--bad); }
.chip-binding { background: var(--gold); color: #14141F; }

.rsec > p { color: var(--fg-dim); font-size: 15px; }

.gap-block { margin-top: 22px; }
.gap-block:first-of-type { margin-top: 4px; }
.gap-head { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; margin-bottom: 8px; }
.gap-rank { color: var(--gold); font-weight: 800; font-size: 15px; }
.gap-name { font-weight: 700; font-size: 17px; }
.gap-score { font-variant-numeric: tabular-nums; color: var(--fg-dim); font-size: 14px; font-weight: 600; }
.gap-block p { color: var(--fg-dim); font-size: 14px; }

.pattern { margin-top: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: rgba(14,14,28,0.45); }
.pattern-name { font-weight: 700; color: var(--gold-light); font-size: 15px; margin-bottom: 6px; }
.pattern p { color: var(--fg-dim); font-size: 14px; }

.money-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 6px; }
.money-card { border: 1px solid var(--line); border-radius: 10px; padding: 18px; background: rgba(14,14,28,0.45); }
.money-label { font-size: 12px; color: var(--fg-faint); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600; }
.money-big { font-size: 25px; font-weight: 800; color: var(--fg); margin: 8px 0 6px; letter-spacing: -0.02em; }
.money-sub { font-size: 12.5px; color: var(--fg-dim); line-height: 1.5; }

.total { margin-top: 18px; padding: 22px; border: 1px solid var(--gold); border-radius: 10px; background: rgba(197,165,90,0.09); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.total-label { font-size: 14px; font-weight: 600; color: var(--fg-dim); }
.total-num { font-size: 34px; font-weight: 800; color: var(--gold); letter-spacing: -0.02em; }
.disclaimer { font-size: 12px; color: var(--fg-faint); margin-top: 14px; line-height: 1.6; }

.priorities { margin-top: 18px; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.priorities li { color: var(--fg-dim); font-size: 15px; padding-left: 6px; }
.priorities li::marker { color: var(--gold); font-weight: 700; }

.rec { border: 1px solid var(--line-2); border-radius: 10px; padding: 24px; background: rgba(14,14,28,0.5); }
.rec p { color: var(--fg-dim); font-size: 15px; margin-top: 10px; }

.ctas { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.btn { font-family: inherit; font-size: 15px; font-weight: 600; padding: 13px 24px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; text-decoration: none; display: inline-block; transition: background .16s, border-color .16s; }
.btn-primary { background: var(--gold); color: #14141F; }
.btn-primary:hover { background: var(--gold-light); }
.btn-ghost { background: transparent; color: var(--gold); border-color: rgba(197,165,90,0.5); }
.btn-ghost:hover { background: rgba(197,165,90,0.1); border-color: var(--gold); }

.debug { font-size: 11px; color: var(--fg-dim); background: #000; padding: 16px; border-radius: 8px; overflow-x: auto; white-space: pre; margin-top: 12px; }

/* ------------------------------------------------------------- mobile */

@media (max-width: 640px) {
  :root { --pad: 24px; }
  body { padding-bottom: 120px; }
  h1 { font-size: 26px; }
  .result-headline { font-size: 24px; }
  h2.q-text { font-size: 21px; }
  .intro-grid { grid-template-columns: 1fr; }
  .fields-two { grid-template-columns: 1fr; }
  .option { font-size: 15px; padding: 15px 17px; }
  .score-row { flex-direction: column; gap: 14px; }
  .score-num { font-size: 54px; }
  .bar-binding { margin-left: -14px; margin-right: -14px; padding: 14px; }
  .nav { padding: 16px 16px; font-size: 14px; }
  #footer { margin: 0 10px 10px; }
}

/* -------------------------------------------------------------- print */

@media print {
  body { background: #fff; color: #111; padding: 0; }
  .wordmark { color: #A8893E; }
  .wordmark span { color: #666; }
  #footer { display: none !important; }
  .card { background: #fff; border: 0; box-shadow: none; padding: 0; }
  .rsec { break-inside: avoid; border-top: 1px solid #ddd; }
  .eyebrow { color: #A8893E; }
  .lede, .sub, .aside, .bar-q, .money-sub, .gap-block p, .pattern p, .rec p, .priorities li, .score-text p, .rsec > p { color: #444; }
  .score-num, .total-num, .gap-rank, .pattern-name { color: #A8893E; }
  .money-card, .pattern, .rec, .total { border-color: #ddd; background: #fafafa; }
  .btn, .ctas, .debug { display: none; }
  h1, h2, h3, .bar-name, .gap-name, .money-big, .score-band { color: #111; }
}
