/* ═══════════════════════════════════════════════════════════════
   TC SCALES — SHARED DESIGN SYSTEM
   "The Goldman Sachs of Healthcare Marketing"
   Institutional · Authoritative · Precise
═══════════════════════════════════════════════════════════════ */

/* ── BRAND TOKENS ─────────────────────────────────────────── */
:root {
  --navy:       #1C3A8A;
  --navy-deep:  #0D1B3E;
  --navy-mid:   #162D6E;
  --electric:   #4A90D9;
  --gold:       #C8A96E;
  --charcoal:   #1A1F2E;
  --gray-600:   #5C6880;
  --gray-400:   #9BA5BB;
  --gray-100:   #EEF0F6;
  --off-white:  #F7F8FC;
  --white:      #FFFFFF;

  /* Dark mode surface tokens */
  --dm-bg:      #0D1B3E;
  --dm-surface: #162D6E;
  --dm-text:    #FEFEFE;
  --dm-subtle:  #9BA5BB;
  --dm-border:  #2C4FA3;

  /* Spacing */
  --section-pad: 96px;
  --container:   1200px;
  --radius:      10px;
  --radius-lg:   16px;
}

/* ── RESET ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--gray-600);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img  { display: block; max-width: 100%; }
a    { color: inherit; text-decoration: none; }
ul   { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ── LAYOUT ───────────────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 2rem;
}
@media (max-width: 768px) {
  .container { padding: 0 1.25rem; }
  /* Prevent any element from causing horizontal overflow */
  img, video, iframe, table, pre { max-width: 100%; }
  /* Break long words/URLs so they don't push content off-screen */
  p, h1, h2, h3, h4, li, td, th { overflow-wrap: break-word; word-break: break-word; }
}
@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  :root { --section-pad: 60px; }
}
.section-pad { padding: var(--section-pad) 0; }
.text-max    { max-width: 680px; }

/* ── TYPOGRAPHY ───────────────────────────────────────────── */
h1, h2, h3, h4 { color: var(--charcoal); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 3.5vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 2.5vw, 1.875rem); font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.0625rem; font-weight: 600; line-height: 1.4; }
p  { color: var(--gray-600); line-height: 1.7; }

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: 'Inter', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  padding: 0 1.5rem;
  height: 48px;
  border-radius: 6px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background .18s, color .18s, box-shadow .18s, transform .15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn-primary:hover {
  background: var(--navy-mid);
  border-color: var(--navy-mid);
  box-shadow: 0 4px 20px rgba(28,58,138,.25);
}

.btn-secondary {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-secondary:hover {
  background: rgba(28,58,138,.06);
}

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: transparent;
  padding: 0 .25rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  height: auto;
}
.btn-ghost:hover { opacity: .75; transform: none; }

/* Dark mode buttons */
html.dark .btn-secondary {
  color: var(--dm-text);
  border-color: rgba(255,255,255,.35);
}
html.dark .btn-secondary:hover { background: rgba(255,255,255,.08); }

/* ── EYEBROW / SECTION LABEL ──────────────────────────────── */
.eyebrow {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}
.gold-rule {
  width: 48px;
  height: 2px;
  background: var(--gold);
  flex-shrink: 0;
}
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gold);
}

/* ── CARDS ────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px rgba(0,0,0,.06);
  transition: transform .2s, box-shadow .2s, border-left .2s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,.1);
  border-left: 3px solid var(--navy);
}

html.dark .card {
  background: var(--dm-surface);
  border-color: var(--dm-border);
}
html.dark .card:hover { border-left-color: var(--electric); }

/* ── NAV ──────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #1e2130;
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: box-shadow .2s, background .2s, border-color .2s;
}
.nav.scrolled {
  box-shadow: 0 2px 24px rgba(0,0,0,.35);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  gap: 2rem;
}
.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -.02em;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex: 1;
}
.nav-links a {
  font-size: .9375rem;
  font-weight: 500;
  color: rgba(255,255,255,.6);
  transition: color .15s;
}
.nav-links a:hover,
.nav-links a.active { color: #ffffff; }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

/* Theme toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: rgba(255,255,255,.6);
  background: transparent;
  border: 1px solid rgba(255,255,255,.12);
  transition: background .15s, color .15s;
  cursor: pointer;
}
.theme-toggle:hover { background: rgba(255,255,255,.08); color: #ffffff; }

/* Nav CTA */
.nav .btn-primary { height: 44px; font-size: .9rem; }

/* Dark mode nav — slightly deeper than light mode */
html.dark .nav {
  background: #12141c;
  border-bottom-color: rgba(255,255,255,.05);
}
html.dark .nav.scrolled { box-shadow: 0 2px 24px rgba(0,0,0,.5); }
html.dark .nav-logo { color: #ffffff; }
html.dark .nav-links a { color: rgba(255,255,255,.55); }
html.dark .nav-links a:hover,
html.dark .nav-links a.active { color: #ffffff; }
html.dark .theme-toggle { border-color: rgba(255,255,255,.1); color: rgba(255,255,255,.55); }
html.dark .theme-toggle:hover { background: rgba(255,255,255,.07); color: #ffffff; }

/* ── HAMBURGER ────────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,.8);
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}
.nav.mobile-open .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.mobile-open .nav-hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav.mobile-open .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
@media (max-width: 768px) {
  .nav-inner { gap: .5rem; height: 60px; }
  .nav-logo { font-size: 1.1rem; }
  .theme-toggle { width: 34px; height: 34px; font-size: .875rem; }

  /* Push nav-actions (theme toggle + hamburger) to far right */
  .nav-actions { margin-left: auto; }

  .nav-hamburger { display: flex; }

  .btn-quiz-trigger { display: none; }

  /* Hide Book a Call from top bar — it lives in the dropdown instead */
  .nav-actions .btn-primary { display: none; }

  /* Nav links become the absolute slide-down dropdown */
  .nav-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 60px;
    left: 0; right: 0;
    background: #1e2130;
    border-top: 1px solid rgba(255,255,255,.08);
    max-height: 0;
    overflow: hidden;
    transition: max-height .32s ease;
    z-index: 99;
  }
  .nav.mobile-open .nav-links { max-height: 400px; }

  .nav-links li { border-bottom: 1px solid rgba(255,255,255,.06); }
  .nav-links a {
    display: block;
    padding: 1rem 1.5rem;
    font-size: 1.0625rem;
    color: rgba(255,255,255,.7);
  }
  .nav-links a:hover,
  .nav-links a.active {
    color: #ffffff;
    background: rgba(255,255,255,.04);
  }

  .nav-mobile-cta { display: block; }
  .nav-mobile-cta a {
    color: #ffffff !important;
    font-weight: 700;
    background: rgba(255,255,255,.06);
  }
}

/* Mobile CTA hidden on desktop */
.nav-mobile-cta { display: none; }

/* ── FOOTER ───────────────────────────────────────────────── */
.footer {
  background: var(--navy-deep);
  color: var(--dm-subtle);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.75fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand .footer-logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -.02em;
  display: block;
  margin-bottom: 1rem;
}
.footer-brand p {
  font-size: .875rem;
  color: var(--dm-subtle);
  line-height: 1.7;
  max-width: 280px;
}
.footer-col h5 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--white);
  margin-bottom: 1rem;
}
.footer-col ul { display: flex; flex-direction: column; gap: .625rem; }
.footer-col a {
  font-size: .875rem;
  color: var(--dm-subtle);
  transition: color .15s;
}
.footer-col a:hover { color: var(--white); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .8125rem;
  color: var(--dm-subtle);
}
.footer-legal { display: flex; gap: 1.5rem; }
.footer-legal a { color: var(--dm-subtle); transition: color .15s; }
.footer-legal a:hover { color: var(--white); }

/* ── PAGE HERO (inner pages) ──────────────────────────────── */
.page-hero {
  padding: 80px 0 64px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
}
.page-hero .eyebrow { margin-bottom: 1.25rem; }
.page-hero h1 { color: var(--charcoal); margin-bottom: 1rem; }
.page-hero p { font-size: 1.0625rem; color: var(--gray-600); max-width: 560px; }

html.dark .page-hero { background: var(--dm-bg); border-bottom-color: var(--dm-border); }
html.dark .page-hero h1 { color: var(--dm-text); }

/* ── DARK MODE GLOBAL ─────────────────────────────────────── */
html.dark body {
  background: var(--dm-bg);
  color: var(--dm-subtle);
}
html.dark h1, html.dark h2, html.dark h3, html.dark h4 { color: var(--dm-text); }
html.dark p { color: var(--dm-subtle); }

/* Section bg overrides in dark mode */
html.dark .bg-white   { background: var(--dm-bg); }
html.dark .bg-offwhite{ background: var(--dm-surface); }

/* ── SECTION BACKGROUNDS ──────────────────────────────────── */
.bg-white    { background: var(--white); }
.bg-offwhite { background: var(--off-white); }
.bg-navy     { background: var(--navy-deep); }

/* Text on navy/dark sections */
.bg-navy h1, .bg-navy h2, .bg-navy h3, .bg-navy h4 { color: var(--white); }
.bg-navy p { color: var(--dm-subtle); }
.bg-navy .eyebrow .section-label { color: var(--gold); }
.bg-navy .gold-rule { background: var(--gold); }

/* ── DIVIDERS ─────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--gray-100);
  margin: 3rem 0;
}
html.dark .divider { border-top-color: var(--dm-border); }

/* ── DARK MODE SCRIPT (apply before paint) ────────────────── */
/* Add this inline script in <head> of every page:
   <script>
     if (localStorage.getItem('theme') === 'dark') {
       document.documentElement.classList.add('dark');
     }
   </script>
*/

/* ── QUIZ MODAL (shared across all pages) ─────────────────── */
.btn-quiz-trigger {
  display: inline-flex; align-items: center; gap: .375rem;
  font-size: .8125rem; font-weight: 700;
  color: var(--gold);
  background: rgba(180,140,40,.1);
  border: 1.5px solid var(--gold);
  border-radius: 8px;
  padding: .45rem .875rem;
  cursor: pointer;
  letter-spacing: .01em;
  transition: background .18s, color .18s;
  white-space: nowrap;
}
.btn-quiz-trigger:hover { background: var(--gold); color: var(--navy-deep); }
.btn-quiz-trigger::before { content: "🎁"; font-size: .85rem; }

.quiz-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(10,20,50,.75);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.quiz-overlay.active { opacity: 1; pointer-events: all; }
.quiz-modal {
  background: var(--white);
  border-radius: 20px;
  width: 100%; max-width: 560px;
  max-height: 90dvh;
  display: flex; flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,.22);
  overflow: hidden;
  transform: translateY(16px) scale(.98);
  transition: transform .3s ease;
}
.quiz-overlay.active .quiz-modal { transform: translateY(0) scale(1); }
.quiz-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.75rem 2rem 2rem;
}
/* Remove expensive blur on low-power mobile */
@media (max-width: 768px) {
  .quiz-overlay { backdrop-filter: none; background: rgba(10,20,50,.88); }
  .quiz-modal { border-radius: 16px; max-height: 92dvh; }
  .quiz-header { padding: 1.25rem 1.25rem 1rem; }
  .quiz-body { padding: 1.25rem 1.25rem 1.5rem; }
}
html.dark .quiz-modal { background: var(--dm-surface); }
.quiz-header { background: var(--navy-deep); padding: 2rem 2rem 1.5rem; position: relative; }
.quiz-close {
  position: absolute; top: 1rem; right: 1rem;
  background: rgba(255,255,255,.12); border: none;
  color: rgba(255,255,255,.7); font-size: 1.125rem;
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.quiz-close:hover { background: rgba(255,255,255,.2); color: #fff; }
.quiz-progress-wrap { margin-bottom: 1rem; }
.quiz-progress-label {
  font-size: .7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .1em; color: rgba(255,255,255,.45); margin-bottom: .4rem;
}
.quiz-progress-bar { height: 3px; background: rgba(255,255,255,.15); border-radius: 99px; overflow: hidden; }
.quiz-progress-fill { height: 100%; background: var(--gold); border-radius: 99px; transition: width .4s ease; }
.quiz-eyebrow {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: var(--gold); margin-bottom: .5rem;
}
.quiz-header h2 { font-size: 1.25rem; font-weight: 700; color: var(--white); line-height: 1.25; margin: 0; }
.quiz-step { display: none; }
.quiz-step.active { display: block; }
.quiz-intro-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.quiz-intro h3 { font-size: 1.375rem; font-weight: 700; color: var(--charcoal); margin-bottom: .75rem; line-height: 1.2; }
html.dark .quiz-intro h3 { color: var(--dm-text); }
.quiz-intro p { font-size: .9375rem; color: var(--gray-600); line-height: 1.7; margin-bottom: .5rem; }
html.dark .quiz-intro p { color: var(--dm-subtle); }
.quiz-deliverable { background: var(--off-white); border: 1px solid var(--gray-100); border-radius: 10px; padding: 1rem 1.125rem; margin: 1.25rem 0; }
html.dark .quiz-deliverable { background: var(--dm-bg); border-color: var(--dm-border); }
.quiz-deliverable-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--navy); margin-bottom: .5rem; }
html.dark .quiz-deliverable-label { color: var(--electric); }
.quiz-deliverable ul { list-style: none; display: flex; flex-direction: column; gap: .375rem; }
.quiz-deliverable li { font-size: .875rem; color: var(--gray-600); display: flex; align-items: center; gap: .5rem; }
html.dark .quiz-deliverable li { color: var(--dm-subtle); }
.quiz-deliverable li::before { content: "✓"; color: var(--navy); font-weight: 700; font-size: .75rem; }
html.dark .quiz-deliverable li::before { color: var(--electric); }
.quiz-q { font-size: 1.0625rem; font-weight: 700; color: var(--charcoal); margin-bottom: 1.25rem; line-height: 1.35; }
html.dark .quiz-q { color: var(--dm-text); }
.quiz-options { display: flex; flex-direction: column; gap: .625rem; }
.quiz-option {
  display: flex; align-items: center; gap: .875rem;
  padding: .875rem 1rem;
  border: 1.5px solid var(--gray-100); border-radius: 10px;
  cursor: pointer; font-size: .9rem; color: var(--charcoal);
  transition: border-color .15s, background .15s; background: var(--white);
}
html.dark .quiz-option { background: var(--dm-bg); border-color: var(--dm-border); color: var(--dm-text); }
.quiz-option:hover { border-color: var(--navy); background: rgba(28,58,138,.04); }
html.dark .quiz-option:hover { border-color: var(--electric); background: rgba(74,144,217,.07); }
.quiz-option.selected { border-color: var(--navy); background: rgba(28,58,138,.07); }
html.dark .quiz-option.selected { border-color: var(--electric); background: rgba(74,144,217,.12); }
.quiz-option-radio {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s;
}
.quiz-option.selected .quiz-option-radio { border-color: var(--navy); background: var(--navy); }
html.dark .quiz-option.selected .quiz-option-radio { border-color: var(--electric); background: var(--electric); }
.quiz-option-radio::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--white); display: none; }
.quiz-option.selected .quiz-option-radio::after { display: block; }
.quiz-option-emoji { font-size: 1.1rem; }
.quiz-capture h3 { font-size: 1.125rem; font-weight: 700; color: var(--charcoal); margin-bottom: .5rem; }
html.dark .quiz-capture h3 { color: var(--dm-text); }
.quiz-capture p { font-size: .875rem; color: var(--gray-600); line-height: 1.65; margin-bottom: 1.25rem; }
html.dark .quiz-capture p { color: var(--dm-subtle); }
.quiz-field { margin-bottom: .875rem; }
.quiz-field label { display: block; font-size: .78rem; font-weight: 600; color: var(--charcoal); margin-bottom: .35rem; }
html.dark .quiz-field label { color: var(--dm-text); }
.quiz-field input {
  width: 100%; padding: .75rem 1rem;
  border: 1.5px solid var(--gray-100); border-radius: 8px;
  font-size: .9375rem; color: var(--charcoal); background: var(--white);
  transition: border-color .15s; box-sizing: border-box;
}
html.dark .quiz-field input { background: var(--dm-bg); border-color: var(--dm-border); color: var(--dm-text); }
.quiz-field input:focus { outline: none; border-color: var(--navy); }
html.dark .quiz-field input:focus { border-color: var(--electric); }
.quiz-privacy { font-size: .75rem; color: var(--gray-400); text-align: center; margin-top: .75rem; }
.quiz-thanks { text-align: center; padding: 1rem 0; }
.quiz-thanks-icon { font-size: 3rem; margin-bottom: 1rem; }
.quiz-thanks h3 { font-size: 1.25rem; font-weight: 700; color: var(--charcoal); margin-bottom: .625rem; }
html.dark .quiz-thanks h3 { color: var(--dm-text); }
.quiz-thanks p { font-size: .9375rem; color: var(--gray-600); line-height: 1.7; margin-bottom: 1.5rem; }
html.dark .quiz-thanks p { color: var(--dm-subtle); }
.quiz-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 1.5rem; gap: 1rem; }
.quiz-footer-right { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.btn-quiz-next {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .75rem 1.5rem; border-radius: 8px;
  font-size: .9rem; font-weight: 700;
  background: var(--navy); color: var(--white); border: none;
  cursor: pointer; transition: background .18s, opacity .18s;
}
.btn-quiz-next:hover { background: #152e7a; }
.btn-quiz-next:disabled { opacity: .4; cursor: not-allowed; }
.btn-quiz-back { font-size: .875rem; font-weight: 600; color: var(--gray-400); background: none; border: none; cursor: pointer; padding: .5rem; }
.btn-quiz-back:hover { color: var(--charcoal); }
