/* SaaS Buyer Desk — visual system v2.1
   Tokens mirror 06_Source/brand-tokens.json exactly.
   Accessibility rules enforced here:
     - Verification Teal is NEVER used for text on white/cloud (marks and shapes only)
     - Signal Blue on Midnight Navy is large text only
     - Body text is Navy or Slate on white/cloud, or White/Sky on Navy
*/

:root {
  --navy:  #0B1530;
  --blue:  #2F6BFF;
  --teal:  #21C3A8;
  --cloud: #F8FAFC;
  --white: #FFFFFF;
  --slate: #475569;
  --ink:   #17213C;
  --sky:   #E9F0FF;
  --line:  #CAD5E8;
  --amber: #F5B84B;

  /* 8px grid */
  --s1: 8px;  --s2: 16px; --s3: 24px; --s4: 32px;
  --s5: 48px; --s6: 64px; --s7: 96px;

  --r1: 16px; --r2: 24px; --r3: 32px; --r4: 48px;

  --wrap: 1120px;
  --font: "Rubik", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 700; line-height: 1.15; color: var(--navy); margin: 0 0 var(--s2); letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.125rem); }
h3 { font-size: 1.1875rem; }
h4 { font-size: 1rem; }

p { margin: 0 0 var(--s2); }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 600; color: var(--navy); }
small { font-size: 0.8125rem; }
img, svg { max-width: 100%; height: auto; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s3); }
.narrow { max-width: 760px; }

/* ---------- skip link ---------- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--navy); color: var(--white); padding: var(--s2) var(--s3);
  border-radius: 0 0 var(--r1) 0;
}
.skip:focus { left: 0; }

/* ---------- header ---------- */
.site-head { background: var(--navy); color: var(--white); }
.site-head .wrap { display: flex; align-items: center; gap: var(--s3); min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: 0 0 auto; }
.brand img { height: 38px; width: auto; display: block; }
.brand span { display: none; }

.nav { margin-left: auto; display: flex; align-items: center; gap: var(--s1); flex-wrap: wrap; }
.nav a {
  color: var(--sky); text-decoration: none; font-size: 0.9375rem; font-weight: 500;
  padding: var(--s1) 12px; border-radius: 10px; white-space: nowrap;
}
.nav a:hover { background: rgba(255,255,255,.08); color: var(--white); }
.nav a[aria-current="page"] { background: rgba(255,255,255,.12); color: var(--white); }
.nav .cta {
  background: var(--blue); color: var(--white); font-weight: 600;
  padding: 10px var(--s2); border-radius: 12px;
}
.nav .cta:hover { background: #1F58EE; }

.navtoggle {
  margin-left: auto; display: none; background: rgba(255,255,255,.1); border: 0;
  color: var(--white); font: inherit; font-size: .9375rem; padding: var(--s1) 14px;
  border-radius: 10px; cursor: pointer;
}

@media (max-width: 860px) {
  .navtoggle { display: block; }
  .nav {
    display: none; width: 100%; order: 3; margin: 0 0 var(--s2);
    flex-direction: column; align-items: stretch; gap: 2px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px var(--s2); }
  .nav .cta { text-align: center; margin-top: var(--s1); }
  .site-head .wrap { flex-wrap: wrap; padding-block: var(--s2); }
}

/* ---------- hero ---------- */
.hero { background: var(--navy); color: var(--sky); padding: var(--s6) 0 var(--s7); }
.hero h1 { color: var(--white); max-width: 18ch; }
.hero .lede { font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); max-width: 60ch; color: var(--sky); }
.rule { width: 96px; height: 5px; border-radius: 999px; background: var(--teal); margin: var(--s3) 0; }
/* Default eyebrow is Slate, which is a legal text colour on white/cloud.
   Teal is switched on ONLY inside navy contexts. This makes the token rule
   "never Verification Teal for text on White/Cloud" structural rather than
   something a future edit can accidentally break. */
.eyebrow {
  font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--slate); margin: 0 0 var(--s2);
}
.hero .eyebrow,
.page-head .eyebrow,
section.navy .eyebrow,
.verdict .eyebrow { color: var(--teal); }

/* Page header for interior pages */
.page-head { background: var(--navy); color: var(--sky); padding: var(--s5) 0 var(--s6); }
.page-head h1 { color: var(--white); }
.page-head p { max-width: 62ch; margin-bottom: 0; }

/* ---------- sections ---------- */
section { padding: var(--s6) 0; }
section.tight { padding: var(--s5) 0; }
section.cloud { background: var(--cloud); }
section.navy { background: var(--navy); color: var(--sky); }
section.navy h2, section.navy h3 { color: var(--white); }

.section-intro { max-width: 62ch; margin-bottom: var(--s5); }
.section-intro p { color: var(--slate); }
section.navy .section-intro p { color: var(--sky); }

/* ---------- grid + cards ---------- */
.grid { display: grid; gap: var(--s3); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r2);
  padding: var(--s4); display: flex; flex-direction: column;
}
.card h3 { margin-bottom: var(--s1); }
.card p { color: var(--slate); margin-bottom: 0; }
.card p + p { margin-top: var(--s2); }
.card .more { margin-top: var(--s3); font-weight: 600; text-decoration: none; }
.card .more::after { content: " \2192"; }
a.card { text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
a.card:hover { border-color: var(--blue); transform: translateY(-2px); }

/* numbered trust signals */
.num {
  width: 40px; height: 40px; border-radius: 999px; background: var(--teal); color: var(--navy);
  display: grid; place-items: center; font-weight: 700; font-size: .875rem; margin-bottom: var(--s2);
}

/* dark card on navy */
.card-dark {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--r2); padding: var(--s4);
}
.card-dark h3 { color: var(--white); }
.card-dark p { color: var(--sky); margin-bottom: 0; }

/* ---------- promise panel ---------- */
.promise {
  background: var(--navy); border-radius: var(--r3); padding: var(--s5);
  color: var(--white);
}
.promise .line { font-size: clamp(1.25rem, 1rem + 1.1vw, 1.75rem); font-weight: 700; line-height: 1.3; margin: 0; }
/* Signal Blue on navy = large text only. This line is 20px+ and bold. */
.promise .line em { font-style: normal; color: var(--blue); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-weight: 600; font-size: 1rem; text-decoration: none;
  padding: 14px var(--s4); border-radius: 14px; border: 1px solid transparent; cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: #1F58EE; }
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.35); }
.btn-ghost:hover { border-color: var(--white); background: rgba(255,255,255,.07); }
.btn-quiet { background: var(--white); color: var(--navy); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--navy); }
.btnrow { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }

/* ---------- prose ---------- */
.prose { max-width: 72ch; }
.prose h2 { margin-top: var(--s6); padding-top: var(--s1); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: var(--s4); }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 var(--s2); }
.prose li { margin-bottom: var(--s1); }
.prose li::marker { color: var(--blue); }
.prose table { width: 100%; border-collapse: collapse; margin: var(--s3) 0; font-size: .9375rem; }
.prose th, .prose td { text-align: left; padding: 12px var(--s2); border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--cloud); color: var(--navy); font-weight: 600; }
.prose blockquote {
  margin: var(--s3) 0; padding: var(--s3) var(--s4);
  background: var(--cloud); border-left: 4px solid var(--teal); border-radius: 0 var(--r1) var(--r1) 0;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.tablewrap { overflow-x: auto; }

/* ---------- disclosure block ---------- */
.disclosure {
  background: var(--sky); border: 1px solid var(--line); border-radius: var(--r1);
  padding: var(--s3); font-size: .9375rem; color: var(--ink); margin: var(--s3) 0;
}
.disclosure strong { display: block; margin-bottom: 4px; }

/* ---------- empty state ---------- */
.empty {
  border: 2px dashed var(--line); border-radius: var(--r2); padding: var(--s5);
  text-align: center; background: var(--cloud);
}
.empty h3 { margin-bottom: var(--s1); }
.empty p { color: var(--slate); max-width: 52ch; margin-inline: auto; }

/* ---------- checklist ---------- */
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { position: relative; padding-left: 34px; margin-bottom: 12px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 20px; height: 20px;
  border-radius: 999px; background: var(--teal);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 10.5l4 4 8-8' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 10.5l4 4 8-8' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ---------- scorecard ---------- */
.sc-step { border: 1px solid var(--line); border-radius: var(--r2); padding: var(--s4); margin-bottom: var(--s3); background: var(--white); }
.sc-step > legend { font-weight: 700; color: var(--navy); font-size: 1.0625rem; padding: 0 var(--s1); }
.sc-help { color: var(--slate); font-size: .9375rem; margin: var(--s1) 0 var(--s3); }
.opts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.opt span {
  display: block; border: 1px solid var(--line); border-radius: 14px; padding: 12px var(--s2);
  cursor: pointer; font-size: .9375rem; background: var(--white); transition: border-color .12s, background .12s;
}
.opt span:hover { border-color: var(--blue); }
.opt input:checked + span { border-color: var(--blue); background: var(--sky); font-weight: 600; color: var(--navy); }
.opt input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---------- scorecard stepper ----------
   The .stepper class is added by JS only. Without JS every question stays
   visible and the plain submit button still works. */
.stepper .sc-step { display: none; }
.stepper .sc-step.active { display: block; animation: sc-in .25s ease; }
/* Questions vary from 4 to 8 options. Without a floor the Continue button
   jumps up and down between steps. */
@media (min-width: 640px) { .stepper .sc-step.active { min-height: 296px; } }
@keyframes sc-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .stepper .sc-step.active { animation: none; } }

.sc-progress { margin-bottom: var(--s4); }
.sc-progress-label {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2);
  font-size: .8125rem; font-weight: 600; color: var(--slate); margin-bottom: 10px;
}
.sc-progress-label .pct { font-variant-numeric: tabular-nums; }
.sc-progress-bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.sc-progress-fill {
  height: 100%; width: 0; background: var(--teal); border-radius: 999px;
  transition: width .3s ease;
}
@media (prefers-reduced-motion: reduce) { .sc-progress-fill { transition: none; } }

.sc-nav { margin-top: var(--s3); align-items: center; }
.sc-nav .sc-hint { font-size: .8125rem; color: var(--slate); margin-left: auto; }
@media (max-width: 520px) { .sc-nav .sc-hint { display: none; } }

.sc-result { display: none; }
.sc-result.show { display: block; }
.verdict {
  background: var(--navy); color: var(--white); border-radius: var(--r3); padding: var(--s5); margin-bottom: var(--s3);
}
.verdict .eyebrow { color: var(--teal); }
.verdict h3 { color: var(--white); font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); margin-bottom: var(--s2); }
.verdict p { color: var(--sky); margin-bottom: 0; }
.stack { display: grid; gap: var(--s2); margin-top: var(--s4); }
.slot {
  display: grid; grid-template-columns: 44px 1fr auto; gap: var(--s2); align-items: start;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--r1); padding: var(--s3);
}
.slot .rank {
  width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center;
  font-weight: 700; font-size: .875rem; background: var(--teal); color: var(--navy);
}
.slot.later .rank { background: rgba(255,255,255,.2); color: var(--white); }
.slot h4 { color: var(--white); margin: 0 0 2px; font-size: 1rem; }
.slot p { color: var(--sky); font-size: .9375rem; margin: 0; }
.slot .tag {
  font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--navy); background: var(--teal); padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.slot.later .tag { background: rgba(255,255,255,.16); color: var(--white); }
.budget {
  background: var(--cloud); border: 1px solid var(--line); border-radius: var(--r2); padding: var(--s4); margin-bottom: var(--s3);
}
.budget h3 { margin-bottom: var(--s2); }
.err { color: #B3261E; font-weight: 600; margin-top: var(--s2); }

/* ---------- footer ---------- */
.site-foot { background: var(--navy); color: var(--sky); padding: var(--s6) 0 var(--s4); margin-top: 0; }
.foot-grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.site-foot img.flogo { height: 40px; margin-bottom: var(--s2); }
.site-foot h4 { color: var(--white); font-size: .8125rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: var(--s2); }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin-bottom: 10px; }
.site-foot a { color: var(--sky); text-decoration: none; font-size: .9375rem; }
.site-foot a:hover { color: var(--white); text-decoration: underline; }
.site-foot .tagline { color: var(--sky); font-size: .9375rem; max-width: 30ch; }
.foot-bottom {
  border-top: 1px solid rgba(255,255,255,.15); margin-top: var(--s5); padding-top: var(--s3);
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); justify-content: space-between;
  font-size: .8125rem; color: #A9B8D4;
}
.foot-bottom p { margin: 0; }

/* ---------- utility ---------- */
.center { text-align: center; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.muted { color: var(--slate); }
section.navy .muted { color: var(--sky); }
.stamp {
  display: inline-flex; align-items: center; gap: 8px; font-size: .8125rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--navy);
  background: var(--teal); padding: 6px 14px; border-radius: 999px;
}

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
section.navy :focus-visible, .site-head :focus-visible, .site-foot :focus-visible { outline-color: var(--teal); }

@media print {
  .site-head, .site-foot, .btnrow, .navtoggle { display: none; }
  body { color: #000; }
}
