/* Copyright © 2026 Bridge Health Syndicate LLC. All rights reserved. */

/* Bridge Health Syndicate — apply page styles.
   Visual design matches docs/reference/ one-pager PDF: light, editorial, mono kickers,
   dark slate used selectively. Palette + type per brief §5.
   Mobile-first: base styles target the phone; desktop layout in min-width media queries. */

:root {
  /* Palette (brief §5) */
  --slate: #15202b;       /* primary text / dark sections */
  --teal: #0e9488;        /* accent: headline accent, key numbers, CTA */
  --deep-teal: #0b6f66;   /* small uppercase labels */
  --mint: #eef6f4;        /* subtle highlight background */
  --hairline: #d7dee1;    /* borders */
  --muted: #6b7884;       /* secondary text */
  --muted-strong: #576570; /* small caps on white — ~5.2:1, clears WCAG AA */
  --white: #ffffff;

  /* Dark-section tones (off-spec but harmonious) */
  --slate-2: #1c2935;
  --on-dark: #e7edf0;
  --on-dark-muted: #9aabb6;
  --teal-light: #3fb3a6;  /* teal that clears AA on slate */
  --danger: #c0392b;

  /* Type */
  --font-sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --line-body: 1.55;

  /* Fluid type scale */
  --fs-display: clamp(2rem, 5.6vw, 3.5rem);
  --fs-h2: clamp(1.6rem, 3.6vw, 2.25rem);
  --fs-figure: clamp(2rem, 5vw, 2.75rem);
  --fs-stat: clamp(1.9rem, 5vw, 2.75rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9375rem;
  --fs-label: 0.6875rem;

  /* Spacing scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;

  --radius: 10px;
  --radius-sm: 7px;
  --container: 75rem; /* 1200px editorial grid (rem-based max line-length, not a screen-res target) */
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }

/* The `hidden` attribute must always win, even on elements whose class sets a display value
   (.form/.field use grid). Standard reset — the accepted !important exception (normalize.css). */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--line-body);
  color: var(--slate);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--teal); }
strong { font-weight: 600; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 2px;
}
.section--dark :focus-visible { outline-color: var(--teal-light); }

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

section { padding-block: clamp(2.5rem, 6vw, 4rem); }

.section--dark { background: var(--slate); color: var(--on-dark); }

/* Responsive 3-up grid used by steps / proof / stats */
.grid-3 { display: grid; gap: var(--sp-4); }
@media (min-width: 46rem) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
}

/* ---------- Utilities ---------- */
.mono-label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--deep-teal);
}
.section--dark .mono-label { color: var(--teal-light); }

.section-label { margin-bottom: var(--sp-5); }

.accent { color: var(--teal); }
.section--dark .accent { color: var(--teal-light); }

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

.skip-link {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(-150%);
  top: var(--sp-2);
  z-index: 100;
  background: var(--teal);
  color: var(--white);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: transform 0.15s ease;
}
.skip-link:focus { transform: translateX(-50%) translateY(0); }

/* ---------- 1. Confidential bar ---------- */
.confidential {
  text-align: center;
  padding-block: var(--sp-3);
  border-bottom: 2px solid var(--slate); /* thick dark rule, matches the one-pager */
}
.confidential .mono-label {
  color: var(--slate);
  font-weight: 600;
  font-size: clamp(0.72rem, 2.4vw, 0.85rem);
}

/* ---------- 2. Masthead ---------- */
.masthead {
  padding-block: var(--sp-5);
  border-bottom: 1px solid var(--hairline);
}
.masthead__inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.wordmark { display: flex; align-items: center; gap: var(--sp-3); }
.wordmark__mark { color: var(--teal); flex: none; }
.wordmark__lines { display: flex; flex-direction: column; gap: 3px; }
.wordmark__text {
  font-weight: 700;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  letter-spacing: 0.06em;
  color: var(--slate);
  line-height: 1.1;
}
.wordmark__sub { color: var(--muted); letter-spacing: 0.24em; }

.masthead__meta { display: flex; flex-direction: column; gap: var(--sp-1); }
.masthead__meta-muted { color: var(--deep-teal); }
.masthead__meta-key { color: var(--deep-teal); font-weight: 500; }

@media (min-width: 46rem) {
  .masthead__inner { flex-direction: row; justify-content: space-between; align-items: center; }
  .masthead__meta { text-align: right; align-items: flex-end; }
}

/* ---------- 3 + 4. Hero ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.hero__kicker { margin-bottom: var(--sp-4); }
.headline {
  font-size: var(--fs-display);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--slate);
  text-wrap: balance;
}
.explainer {
  margin-top: var(--sp-5);
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.6vw, 1.2rem);
}
.helix-tag { margin-top: var(--sp-4); color: var(--muted); }

/* ---------- HIPAA trust box ---------- */
.hipaa-wrap { padding-block: 0; }
.hipaa {
  display: flex;
  gap: var(--sp-4);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--mint);
  border: 1px solid #cfe6e1;
  border-radius: var(--radius);
}
.hipaa__icon { color: var(--teal); flex: none; margin-top: 2px; }
.hipaa__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
  font-weight: 700;
  color: var(--slate);
  margin-bottom: var(--sp-3);
}
.hipaa__list { display: grid; gap: var(--sp-2); color: var(--slate); font-size: var(--fs-small); }
.hipaa__list li { position: relative; padding-left: 1.5rem; }
.hipaa__list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--teal);
  font-weight: 700;
}
@media (min-width: 40rem) {
  .hipaa__list { grid-template-columns: 1fr 1fr; gap: var(--sp-2) var(--sp-6); }
}

/* ---------- 7. How it works ---------- */
/* Extra air under the heading so "HOW IT WORKS" doesn't read as part of step 01. */
.how .section-label { margin-bottom: var(--sp-6); }
/* Number sits ABOVE its rule (number → rule → title); larger than the section
   label so "01" is clearly distinct from the "HOW IT WORKS" heading. */
.step__num {
  display: block;
  color: var(--teal);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  padding-bottom: var(--sp-3);
  border-bottom: 2px solid var(--slate);
  margin-bottom: var(--sp-4);
}
.step__lead { font-size: 1.1875rem; font-weight: 700; color: var(--slate); }
.step__body { margin-top: var(--sp-2); color: var(--muted); font-size: var(--fs-small); }

/* ---------- 5. Proof cards ---------- */
.card {
  padding: var(--sp-5);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--white);
}
/* Tighter tracking + smaller so longer kickers (e.g. "LINKED DENTAL + MEDICAL · TARGET")
   stay on one line inside a one-third card. */
.card__kicker { color: var(--muted-strong); margin-bottom: var(--sp-3); letter-spacing: 0.1em; font-size: 0.625rem; }
.card__name { font-size: 1.0625rem; font-weight: 700; color: var(--slate); }
.card__figure {
  margin-top: var(--sp-1);
  font-size: var(--fs-figure);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--teal);
  line-height: 1;
}
.card__figure--soft { font-size: 1.5rem; }
.card__caption { margin-top: var(--sp-3); font-size: var(--fs-small); color: var(--muted); }

.card--target {
  background: var(--slate);
  border-color: var(--slate);
  color: var(--on-dark);
}
.card--target .card__kicker { color: var(--teal-light); }
.card--target .card__name { color: var(--white); }
.card--target .card__figure { color: var(--teal-light); }
.card--target .card__caption { color: var(--on-dark-muted); }

/* ---------- 6. Scarcity ---------- */
.stats { text-align: left; }
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: var(--slate-2);
}
.stat__label { color: var(--on-dark-muted); }
.stat__num {
  font-size: var(--fs-stat);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.stat__num--live { color: var(--teal-light); }
.stat__num--sm { font-size: clamp(1.5rem, 4vw, 2rem); }

.scarcity__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  margin-top: var(--sp-6);
  padding-top: var(--sp-6);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.countdown__caption { display: block; margin-bottom: var(--sp-3); color: var(--on-dark-muted); }
.countdown__units { display: flex; gap: var(--sp-5); font-variant-numeric: tabular-nums; }
.countdown__unit { display: flex; flex-direction: column; gap: var(--sp-1); }
.countdown__value { font-size: clamp(1.6rem, 5vw, 2.25rem); font-weight: 700; line-height: 1; color: var(--white); }
.countdown__unit-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
}
.countdown__closed { font-weight: 600; color: var(--teal-light); }
.countdown__fallback { font-weight: 600; color: var(--white); }
.scarcity__close { color: var(--on-dark-muted); }

.scarcity__note {
  margin-top: var(--sp-6);
  font-size: var(--fs-small);
  color: var(--on-dark-muted);
}

/* ---------- 8. Apply ---------- */
.apply { background: var(--mint); }
.apply__inner { display: grid; gap: clamp(2rem, 5vw, 3.5rem); }

.apply__heading {
  margin-top: var(--sp-3);
  font-size: var(--fs-h2);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--slate);
  line-height: 1.1;
}
.apply__subhead { margin-top: var(--sp-3); color: var(--slate); font-weight: 500; }
.apply__reassure { margin-top: var(--sp-4); color: var(--muted); font-size: var(--fs-small); max-width: 40ch; }

.apply__formwrap {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.25rem);
}

@media (min-width: 56rem) {
  .apply__inner { grid-template-columns: 1fr minmax(0, 30rem); align-items: start; }
  .apply__intro { position: sticky; top: var(--sp-6); }
}

.form { display: grid; gap: var(--sp-5); }

.form__closed {
  padding: var(--sp-4);
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--slate);
  background: var(--mint);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
}
.field { display: grid; gap: var(--sp-2); }
.field__label { color: var(--deep-teal); }

.field__input {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 16px; /* ≥16px prevents iOS focus zoom */
  color: var(--slate);
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field__input::placeholder { color: var(--muted); }
.field__input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 148, 136, 0.18);
}
.field__input[aria-invalid="true"] { border-color: var(--danger); }
.field__input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.18); }

.select-wrap { position: relative; }
.field__select { appearance: none; -webkit-appearance: none; padding-right: 2.5rem; cursor: pointer; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}
.field__select:required:invalid { color: var(--muted); }

.field__error { font-size: 0.8125rem; color: var(--danger); }
.field__error:empty { display: none; }

.form__error {
  padding: var(--sp-4);
  font-size: var(--fs-small);
  color: var(--danger);
  background: #fdecea;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
}

/* CTA */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: var(--sp-3) var(--sp-6);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.btn--submit { width: 100%; background: var(--teal); color: var(--white); }
.btn--submit:hover { background: var(--deep-teal); }
.btn--submit:disabled { opacity: 0.65; cursor: progress; }

/* Honeypot — off-screen, never shown, never tab-reachable */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- 9. Confirmation ---------- */
.confirmation {
  padding: clamp(0.5rem, 2vw, 1rem) 0;
}
.confirmation__eyebrow { color: var(--deep-teal); }
.confirmation__title {
  margin-top: var(--sp-3);
  font-size: var(--fs-h2);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--slate);
  line-height: 1.1;
}
.confirmation__body { margin-top: var(--sp-4); color: var(--muted); }
.confirmation__scarcity { margin-top: var(--sp-4); font-weight: 600; color: var(--slate); }
.confirmation__sig {
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--hairline);
  font-weight: 600;
  color: var(--slate);
}

/* ---------- 10. Legal footer ---------- */
.legal {
  background: var(--white);
  /* No top rule — the mint apply section above provides a natural color divider. */
  padding-block: clamp(1.25rem, 3vw, 1.75rem);
}
.legal__confidential {
  display: block;
  text-align: center;
  color: var(--slate);
  font-weight: 600;
  font-size: clamp(0.72rem, 2.4vw, 0.85rem);
  margin-bottom: var(--sp-4);
}
.legal__disclaimer {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: var(--sp-4);
}
.legal__row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.legal__copyright,
.legal__trademark { font-size: 0.75rem; color: var(--muted); }
@media (min-width: 40rem) {
  .legal__row { flex-direction: row; justify-content: space-between; align-items: baseline; gap: var(--sp-6); }
  /* Cap the trademark line so it wraps to a tidy block instead of crowding the copyright. */
  .legal__trademark { text-align: right; max-width: 34ch; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .confirmation[data-enter] { animation: fade-in 0.35s ease both; }
  @keyframes fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
  }
}
