/* Website Launcher — First Signal brand v2.0.
   Colour and type come from fs-tokens.css, vendored verbatim from the First Signal marketing
   repo so any drift from the locked brand is visible as a diff rather than hidden in edits here.
   Fonts are self-hosted: this app's CSP allows no external styles or fonts, and a customer
   portal should not announce its visitors to a third party. */

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/instrument-serif-400.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/manrope-variable.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-variable.woff2") format("woff2");
}

:root {
  /* Semantic layer over the brand tokens. Everything downstream speaks in these names, so a
     brand revision is a change to fs-tokens.css plus this block, not a sweep of the stylesheets. */
  --ink: var(--fs-text);
  --muted: var(--fs-muted);
  --canvas: var(--fs-bg);
  --surface: var(--fs-surface);
  --raised: var(--fs-raised);
  --panel: var(--fs-panel);
  --panel-raised: var(--fs-panel-raised);
  --gold: var(--fs-accent);
  --gold-bloom: var(--fs-accent-bloom);
  --line: color-mix(in srgb, var(--fs-silver-300) 16%, transparent);
  --line-strong: var(--fs-border);
  --danger: #ff8a72;
  --radius: var(--fs-radius);
  --max: var(--fs-max);
  --shadow: 0 24px 70px rgba(2, 10, 18, 0.55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--fs-font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: fixed;
  left: -999px;
  top: 1rem;
  z-index: 100;
  background: var(--gold);
  color: var(--fs-midnight-950);
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  font-weight: 700;
}
.skip-link:focus { left: 1rem; }

/* Header ------------------------------------------------------------------ */

.site-header {
  max-width: var(--max);
  margin: auto;
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--ink);
  text-decoration: none;
}
.brand-wordmark { display: block; height: 30px; width: auto; }
.brand-descriptor {
  padding-left: 0.9rem;
  border-left: 1px solid var(--line-strong);
  font-family: var(--fs-font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fs-silver-300);
}

.header-link {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  padding-bottom: 2px;
}
.header-link:hover { color: var(--gold-bloom); border-bottom-color: var(--gold-bloom); }

main { overflow: hidden; }

/* Hero -------------------------------------------------------------------- */

.hero {
  max-width: var(--max);
  margin: 1.5rem auto 5.5rem;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 3.5rem;
  align-items: end;
}

.hero-copy { padding: 4rem 0 1rem; }

.eyebrow {
  margin: 0 0 1.25rem;
  color: var(--gold);
  font-family: var(--fs-font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 860px;
  margin: 0;
  font-family: var(--fs-font-display);
  font-size: clamp(3rem, 6.4vw, 5.75rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.02;
}

.hero-lede {
  max-width: 640px;
  margin: 1.75rem 0;
  font-size: 1.1rem;
  color: var(--fs-text-secondary);
}

.hero-notes { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.hero-notes span {
  padding: 0.5rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--fs-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--fs-silver-300);
}

.hero-aside {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}
/* The incoming gold signal line — the brand's motion treatment, held still. */
.hero-aside:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold) 55%, transparent);
}

.aside-kicker {
  margin: 0 0 1.5rem;
  color: var(--gold);
  font-family: var(--fs-font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.hero-aside ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 1.5rem; }
.hero-aside li { display: grid; grid-template-columns: 40px 1fr; gap: 0.85rem; align-items: start; }
.hero-aside li > span {
  font-family: var(--fs-font-mono);
  color: var(--gold);
  font-size: 0.95rem;
  padding-top: 0.15rem;
}
.hero-aside strong, .hero-aside small { display: block; }
.hero-aside strong { font-weight: 600; }
.hero-aside small { color: var(--muted); margin-top: 0.25rem; line-height: 1.5; }

/* Launcher shell ---------------------------------------------------------- */

.launcher-shell {
  max-width: var(--max);
  margin: 0 auto 6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 3.75rem);
}

.launcher-intro { max-width: 660px; }

.launcher-intro h2, .promise h2 {
  font-family: var(--fs-font-display);
  font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.05;
  margin: 0.3rem 0 1rem;
}
.launcher-intro > p:last-child, .promise > p:last-child { color: var(--muted); font-size: 1.02rem; }

.progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 3rem 0 2.5rem;
}
.progress-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-family: var(--fs-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-top: 2px solid var(--line);
  padding-top: 0.85rem;
}
.progress-item b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius);
  background: var(--raised);
  color: var(--muted);
  font-size: 0.7rem;
}
.progress-item.is-active { color: var(--ink); border-color: var(--gold); }
.progress-item.is-active b { background: var(--gold); color: var(--fs-midnight-950); }

.form-step h3, .result-panel h3 {
  font-family: var(--fs-font-display);
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.1;
  margin: 0.2rem 0 0.7rem;
}

.step-count {
  color: var(--gold);
  font-family: var(--fs-font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0;
}
.step-copy { color: var(--muted); margin: 0 0 2rem; }

/* Choices and plans ------------------------------------------------------- */

.choice-grid, .plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.choice-card {
  position: relative;
  min-height: 200px;
  padding: 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
  background: var(--raised);
}
.choice-card:hover { border-color: var(--line-strong); }
.choice-card:has(input:checked) { border-color: var(--gold); background: var(--panel); }
.choice-card input { position: absolute; top: 1rem; right: 1rem; accent-color: var(--gold); width: 17px; height: 17px; }
.choice-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  color: var(--gold);
  font-family: var(--fs-font-mono);
  font-size: 0.95rem;
  margin-bottom: auto;
}
.choice-card strong { margin-top: 1.4rem; font-weight: 600; }
.choice-card small { margin-top: 0.35rem; color: var(--muted); line-height: 1.5; }

/* Fields ------------------------------------------------------------------ */

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.field-grid label { display: grid; gap: 0.45rem; }
.field-grid label > span { font-weight: 600; font-size: 0.86rem; }
.field-grid em { font-weight: 400; color: var(--muted); font-style: normal; }
.field-grid .wide { grid-column: 1 / -1; }

input, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
  background: var(--fs-midnight-950);
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-color: var(--gold);
}
textarea { resize: vertical; }

/* Buttons ----------------------------------------------------------------- */

.form-actions { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; }
.form-actions.end { justify-content: flex-end; }

.button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.85rem 1.4rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
/* Gold is the signal colour and stays scarce — primary actions only. */
.button.primary { background: var(--gold); color: var(--fs-midnight-950); }
.button.primary:hover { background: var(--gold-bloom); }
.button.quiet { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.button.quiet:hover { border-color: var(--gold); color: var(--gold); }
.button:disabled { opacity: 0.45; cursor: wait; }

.plan-grid { grid-template-columns: 1fr 1fr; }
.plan-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; background: var(--raised); }
.plan-card.selected { background: var(--panel); border-color: var(--gold); }
.plan-label {
  font-family: var(--fs-font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 500;
  color: var(--gold);
  margin: 0;
}
.selected .plan-label { color: var(--gold); }
.plan-card h4 { font-family: var(--fs-font-display); font-size: 1.7rem; font-weight: 400; margin: 0.4rem 0; }
.price { font-family: var(--fs-font-mono); font-size: 1.4rem; font-weight: 500; margin: 0.7rem 0; color: var(--ink); }
.price small { display: block; font-size: 0.72rem; font-weight: 400; color: var(--muted); margin-top: 0.25rem; }
.plan-card ul { padding-left: 1.1rem; margin: 0; color: var(--fs-text-secondary); }
.plan-card li { margin: 0.4rem 0; }
.payment-note { font-size: 0.76rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 0.85rem; margin-bottom: 0; }

.confirmation {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin: 1.5rem 0 0;
  padding: 1rem;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.confirmation input { width: 17px; height: 17px; margin-top: 0.25rem; accent-color: var(--gold); }

/* Result ------------------------------------------------------------------ */

.result-panel {
  margin-top: 2rem;
  padding: 2rem;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}
.status-strip { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 1.5rem 0; }
.status-strip span {
  background: var(--fs-green-950);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-family: var(--fs-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--fs-silver-300);
}

.form-message { min-height: 1.4rem; margin: 1rem 0 0; color: var(--danger); font-weight: 600; }
.form-message[data-kind="status"] { color: var(--fs-silver-300); font-weight: 400; }

/* Sign-in gate and account state ------------------------------------------ */

.signin-panel { max-width: 520px; margin-top: 2.5rem; }
.signin-panel form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.signin-panel label { display: grid; gap: 0.45rem; font-size: 0.86rem; font-weight: 600; }
.signin-panel .button { justify-self: start; }
.signin-sent {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--fs-text-secondary);
}

.account-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--fs-font-mono);
  font-size: 0.76rem;
  color: var(--muted);
}
.account-strip strong { color: var(--ink); font-weight: 500; }

.pending-panel {
  margin-top: 2rem;
  padding: 2rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
}
.pending-panel > p { color: var(--fs-text-secondary); max-width: 640px; }
.pending-note { margin-bottom: 0; color: var(--muted); font-size: 0.9rem; }

.promise { max-width: 820px; margin: 0 auto 7rem; padding: 0 2rem; text-align: center; }

footer {
  max-width: var(--max);
  margin: auto;
  padding: 2rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.84rem;
}
footer span:first-child { font-weight: 600; color: var(--ink); }

[hidden] { display: none !important; }

@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-copy { padding: 2.5rem 0 0.5rem; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice-card { min-height: 0; }
  .progress-item { font-size: 0; gap: 0; }
  .progress-item b { font-size: 0.7rem; }
  .field-grid, .plan-grid { grid-template-columns: 1fr; }
  .field-grid .wide { grid-column: auto; }
}

@media (max-width: 540px) {
  .site-header, .hero { padding-left: 1.1rem; padding-right: 1.1rem; }
  .site-header { flex-wrap: wrap; }
  .brand-descriptor { display: none; }
  .header-link { display: none; }
  .hero h1 { font-size: 2.6rem; }
  .launcher-shell { margin-left: 0.75rem; margin-right: 0.75rem; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions.end { align-items: stretch; }
  .button { width: 100%; }
  footer { flex-direction: column; padding: 1.5rem 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
