/* packages/webapp-ssr/public/assets/site.css
 * Shared visual system for non-SSR static pages (privacy-policy, terms-of-use,
 * and eventually the home page once it moves off the accordion layout) -
 * extracted from the landing-page redesign mockup. Full-width flex/grid
 * sections with alternating backgrounds, not the older "card floating on a
 * background image" pattern still used by 404.html.
 *
 * Fonts load via the same Google Fonts <link> pattern index.html already
 * uses (see firebase.json's CSP: font-src/style-src already allow
 * fonts.gstatic.com/fonts.googleapis.com) - no need to embed font data the
 * way the Artifact-sandboxed mockup did, that was a CSP-sandbox workaround,
 * not something this site needs.
 */

:root {
  --ground: #FAFAFA;
  --surface: #FFFFFF;
  --surface-sunken: #F1F3F5;
  --ink: #14181D;
  --ink-muted: #4B5563;
  --ink-faint: #8A93A0;
  --border: #E2E6EA;
  --border-strong: #C9D0D8;
  --blue: #185FA5;
  --blue-soft: #E8F0F8;
  --green: #3B6D11;
  --green-soft: #EAF1E2;
  --red: #A32D2D;
  --red-soft: #FCEBEB;
  --amber: #A35F00;
  --amber-soft: #FBF0E2;
  --focus-ring: #185FA5;
  --shadow: 0 1px 2px rgba(20, 24, 29, 0.04), 0 8px 24px rgba(20, 24, 29, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #121212;
    --surface: #191B1E;
    --surface-sunken: #1F2226;
    --ink: #EDEFF2;
    --ink-muted: #A7AFB9;
    --ink-faint: #6B7280;
    --border: #2B2F34;
    --border-strong: #3A3F45;
    --blue: #4C8FD1;
    --blue-soft: #1B2733;
    --green: #5C9C2E;
    --green-soft: #1D2818;
    --red: #C24949;
    --red-soft: #2E1C1C;
    --amber: #D97706;
    --amber-soft: #2E2412;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.4);
  }
}
:root[data-theme="dark"] {
  --ground: #121212;
  --surface: #191B1E;
  --surface-sunken: #1F2226;
  --ink: #EDEFF2;
  --ink-muted: #A7AFB9;
  --ink-faint: #6B7280;
  --border: #2B2F34;
  --border-strong: #3A3F45;
  --blue: #4C8FD1;
  --blue-soft: #1B2733;
  --green: #5C9C2E;
  --green-soft: #1D2818;
  --red: #C24949;
  --red-soft: #2E1C1C;
  --amber: #D97706;
  --amber-soft: #2E2412;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Nav ---------- */
.nav {
  border-bottom: 1px solid var(--border);
  background: var(--ground);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.brand svg { display: block; }
.brand-word {
  font-size: 33px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.brand-word .c { color: var(--green); }
.brand-word .u { color: var(--blue); }
.nav-cta {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--border-strong);
  padding: 8px 16px;
  border-radius: 3px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.nav-cta:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- Typography ---------- */
.eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 18px;
}
h1 {
  font-size: 39px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  text-wrap: balance;
}
h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  text-wrap: balance;
}
h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 8px;
}
.lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-muted);
  margin: 0 0 8px;
}

/* ---------- Sections ---------- */
section { padding: 64px 0; }
.section-alt { background: var(--surface-sunken); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.hero { padding: 64px 0 80px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero-grid img { display: block; width: 100%; height: auto; border-radius: 4px; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  padding: 13px 22px;
  border-radius: 3px;
  border: 1px solid var(--blue);
  cursor: pointer;
  transition: filter 0.15s ease;
}
.btn-primary:hover { filter: brightness(0.88); }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
}
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-faint);
}
.footer-links {
  display: flex;
  gap: 20px;
  font-size: 13px;
}
.footer-links a { color: var(--ink-faint); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Long-form content page (privacy-policy, terms-of-use) ---------- */
.page-content { max-width: 720px; }
.page-content .lede { max-width: 68ch; }
.clause { padding: 28px 0; border-top: 1px solid var(--border); }
.clause:first-of-type { border-top: none; padding-top: 8px; }
.clause p, .clause li { color: var(--ink-muted); font-size: 15.5px; line-height: 1.65; }
.clause ul { padding-left: 22px; margin: 12px 0; }
.clause li { margin-bottom: 8px; }
.clause a { color: var(--blue); }

/* ---------- Hero note/actions (landing page) ---------- */
.hero-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.hero-note {
  font-size: 13px;
  color: var(--ink-faint);
}

/* ---------- Manifest stub cards (landing page hero) ---------- */
.stub-caption {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px;
}
.stub-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stub {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stub-body {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 18px 20px;
  gap: 16px;
}
.stub-field-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 4px;
}
.stub-field-value {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  color: var(--ink);
  word-break: break-all;
}
.stub-verdict {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-left: 16px;
  border-left: 1px dashed var(--border-strong);
  min-width: 92px;
}
.stub-verdict-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stub.is-clear .stub-verdict-mark { background: var(--green-soft); }
.stub.is-pending .stub-verdict-mark { background: var(--amber-soft); }
.stub.is-flagged .stub-verdict-mark { background: var(--red-soft); }
.stub-verdict-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stub.is-clear .stub-verdict-label { color: var(--green); }
.stub.is-pending .stub-verdict-label { color: var(--amber); }
.stub.is-flagged .stub-verdict-label { color: var(--red); }
.stub-perf {
  height: 8px;
  background-image: radial-gradient(circle, var(--ground) 2.5px, transparent 2.6px);
  background-size: 14px 8px;
  background-position: center;
  border-top: 1px dashed var(--border-strong);
}
.stub-reason {
  padding: 10px 20px 16px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

/* ---------- Three-outcomes stages ---------- */
.section-head { max-width: 56ch; margin: 0 0 48px; }
.section-lede {
  font-size: 16.5px;
  color: var(--ink-muted);
  margin: 0;
  max-width: 60ch;
}
.stages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.stage {
  background: var(--surface);
  padding: 32px 28px;
}
.stage-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin: 0 0 16px;
}
.stage.is-pass .stage-dot { background: var(--green); }
.stage.is-pending .stage-dot { background: var(--amber); }
.stage.is-rejected .stage-dot { background: var(--red); }
.stage p {
  font-size: 14.5px;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.6;
}
.reason-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.reason-chip {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 4px 9px;
  border-radius: 3px;
  border: 1px solid var(--border-strong);
  color: var(--ink-muted);
}

/* ---------- Threat cards ---------- */
.threats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.threat {
  background: var(--surface);
  padding: 28px 28px;
}
.threat p {
  font-size: 14px;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.6;
}

/* ---------- CTA panel (Register Interest) ---------- */
.cta-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow);
  padding: 44px 48px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
}
.cta-panel h2 { margin-bottom: 10px; }
.cta-panel .section-lede { margin-bottom: 0; }
.cta-form {
  display: flex;
  gap: 10px;
}
.cta-form input[type="email"] {
  flex: 1;
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--ground);
  color: var(--ink);
  min-width: 0;
}
.cta-form input[type="email"]::placeholder { color: var(--ink-faint); }
.cta-fine {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: 12px 0 0;
}
.cta-fine a { color: var(--ink-faint); text-decoration: underline; }
.cta-result {
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 3px;
  margin: 0;
}
.cta-result.is-success { background: var(--green-soft); color: var(--green); }
.cta-result.is-error { background: var(--red-soft); color: var(--red); }

.annot {
  margin: 0 0 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-soft);
  display: inline-block;
  padding: 3px 9px;
  border-radius: 3px;
}

@media (max-width: 860px) {
  h1 { font-size: 32px; }
  .wrap { padding: 0 20px; }
  .hero-grid { grid-template-columns: 1fr; }
  .stages { grid-template-columns: 1fr; }
  .threats { grid-template-columns: 1fr; }
  .cta-panel { grid-template-columns: 1fr; padding: 32px 28px; }
  .cta-form { flex-direction: column; }
}
