/* FairBill Enrollment Portal — visual system.
   Vanilla CSS, no preprocessor, no framework.

   BRAND. The portal is a FairBill product with an IronHorse leg, so it wears
   FairBill's identity (fairbillsolutions.com): deep navy ground #00395A,
   green #78A22F as the action color, white type on navy, the FairBill
   wordmark. IronHorse's identity (ironhorsepowerservices.com: navy #002352,
   gold #FFCA08) marks everything that belongs to the IronHorse leg — the
   energy option card, its panel and its result — so the two legs read as
   two brands side by side. A partner's own accent colors only the partner
   mark (--partner-accent); it never repaints the chrome. */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  /* No webfont: the CSP is 'self' for styles and fonts, and a page that
     takes SSNs must not call a font CDN (it would hand every broker's IP to
     a third party). The brand's own face (Sharp Sans, a licensed font) lives
     in the wordmark image; the UI uses the platform's geometric sans, which
     sits closest to it. Ship the licensed woff2 into assets/fonts/ and add
     it here if the brand face is wanted in the UI too. */
  font-family: "Avenir Next", "Segoe UI Variable Display", -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  background: var(--bg);
  transition: background-color .18s ease, color .18s ease;
}
h1, h2, h3, p, dl, dd, figure { margin: 0; }
ol, ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
/* An explicit `display` in a component rule beats the UA's [hidden] rule, so
   an element like `.btn[hidden]` would still paint. State this once. */
[hidden] { display: none !important; }
svg { overflow: visible; }
a { color: var(--accent); }

/* ---------- Tokens ---------- */
:root {
  /* FairBill brand */
  --fb-navy: #00395a;
  --fb-navy-deep: #002a44;
  --fb-navy-ink: #ffffff;
  --fb-green: #78a22f;        /* fills (buttons, checks) — white bold type on it, as on the brand site */
  --fb-green-text: #5b7f22;   /* the same green darkened for small text/links (AA on white) */

  /* IronHorse brand — the energy leg only */
  --ih-navy: #002352;
  --ih-gold: #ffca08;
  --ih-gold-soft: #fff6d1;

  /* action color = FairBill green */
  --accent: var(--fb-green-text);
  --accent-fill: var(--fb-green);
  --accent-ink: #ffffff;
  --accent-soft: #eef5e2;

  /* the partner's own color: their mark only */
  --partner-accent: var(--fb-navy);

  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #f6f9fb;
  --border: #dbe3ea;
  --ink: #0f2436;
  --ink-soft: #4a5b6a;
  --ink-faint: #7f8e9b;

  --good: #4f7a1a;
  --good-soft: #eef5e2;
  --bad: #c8352c;
  --bad-soft: #fdeceb;
  --warn: #a9660a;
  --warn-soft: #fdf1de;

  /* chrome: FairBill navy */
  --chrome-bg: var(--fb-navy);
  --chrome-ink: #ffffff;
  --chrome-ink-soft: rgba(255, 255, 255, .72);
  --chrome-line: rgba(255, 255, 255, .14);
  --chrome-surface: rgba(255, 255, 255, .10);

  --shadow-sm: 0 1px 2px rgba(20, 22, 30, .06);
  --shadow-md: 0 6px 20px rgba(20, 22, 30, .08);
  --shadow-lg: 0 18px 48px rgba(20, 22, 30, .16);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --dur-fast: 120ms;
  --dur-med: 220ms;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

html[data-theme="dark"] {
  /* dark = the brand navy, deepened */
  --bg: #04182a;
  --surface: #082539;
  --surface-2: #0d3049;
  --border: #1b4460;
  --ink: #eaf1f6;
  --ink-soft: #b3c4d1;
  --ink-faint: #7f98ab;

  --accent: #9cc555;
  --accent-soft: #163a22;
  --good: #9cc555;
  --good-soft: #163a22;
  --bad-soft: #3a1a17;
  --warn-soft: #3a2b12;
  --ih-gold-soft: #3d3110;

  --chrome-bg: var(--fb-navy-deep);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, .45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #04182a;
    --surface: #082539;
    --surface-2: #0d3049;
    --border: #1b4460;
    --ink: #eaf1f6;
    --ink-soft: #b3c4d1;
    --ink-faint: #7f98ab;

    --accent: #9cc555;
    --accent-soft: #163a22;
    --good: #9cc555;
    --good-soft: #163a22;
    --bad-soft: #3a1a17;
    --warn-soft: #3a2b12;
    --ih-gold-soft: #3d3110;

    --chrome-bg: var(--fb-navy-deep);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 6px 24px rgba(0, 0, 0, .45);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

/* ---------- Accessibility helpers ---------- */
.sr-only {
  position: absolute; 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: 8px; top: -48px;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: var(--radius-sm);
  z-index: 1000; transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: 8px; }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible, .option-card:focus-within, .campaign-card:focus-within {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Icons ---------- */
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.icon-lg { width: 28px; height: 28px; }
.icon-xl { width: 40px; height: 40px; }
.icon-spin { display: none; animation: spin 0.85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout shell ---------- */
#app-root { min-height: 100%; display: flex; flex-direction: column; }
#main { flex: 1; display: flex; flex-direction: column; }

/* ---------- Topbar (FairBill navy chrome) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--chrome-bg);
  color: var(--chrome-ink);
  border-bottom: 3px solid var(--fb-green);
  box-shadow: 0 2px 14px rgba(0, 20, 40, .18);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; gap: 24px;
  padding: 10px 20px;
}
.brand { display: flex; align-items: center; gap: 12px; flex: none; min-width: 0; }
.fb-wordmark { display: block; height: 26px; width: auto; flex: none; }
.brand-divider { width: 1px; height: 28px; background: var(--chrome-line); flex: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--chrome-surface); color: var(--chrome-ink);
  box-shadow: inset 0 0 0 1.5px var(--partner-accent);
  display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none;
}
.brand-logo { width: 100%; height: 100%; object-fit: cover; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name {
  font-weight: 700; font-size: 14px; color: var(--chrome-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px;
}
.brand-sub { font-size: 11px; color: var(--chrome-ink-soft); letter-spacing: .04em; text-transform: uppercase; }
.actas { display: flex; align-items: center; gap: 6px; flex: none; }
.actas input[type="text"] {
  width: 84px; height: 30px; padding: 0 10px; font-size: 12.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; text-align: center;
  background: var(--chrome-surface); border: 1px solid var(--chrome-line); color: var(--chrome-ink);
  border-radius: 999px; flex: none;
}
.actas input[type="text"]::placeholder { color: var(--chrome-ink-soft); letter-spacing: normal; font-weight: 600; }
.actas input[type="text"]:hover { border-color: var(--chrome-line); }
.actas input[type="text"]:focus { outline: none; border-color: var(--fb-green); box-shadow: 0 0 0 3px rgba(120,162,47,.35); }
.actas .btn-sm {
  height: 30px; padding: 0 12px; font-size: 12.5px; white-space: nowrap;
  color: var(--chrome-ink); border-color: var(--chrome-line); background: transparent;
}
.actas .btn-sm:hover:not(:disabled) { background: var(--chrome-surface); color: var(--chrome-ink); }
@media (max-width: 860px) { .actas { display: none; } }

.demo-badge {
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; flex: none; white-space: nowrap;
  background: var(--warn); color: #fff;
}

.progress-rail { flex: 1; display: flex; justify-content: center; min-width: 0; }
.progress-rail ol { display: flex; align-items: center; gap: 6px; }
.step-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; padding: 6px 10px; border-radius: 999px;
  cursor: not-allowed; opacity: .55;
  transition: background-color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.step.is-visited .step-btn { cursor: pointer; opacity: 1; }
.step.is-visited .step-btn:hover { background: var(--chrome-surface); }
.step-dot {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1.5px solid var(--chrome-line);
  font-size: 12px; font-weight: 700; color: var(--chrome-ink-soft);
  position: relative;
}
.step-check { display: none; width: 13px; height: 13px; color: var(--fb-navy); }
.step.is-current .step-dot {
  border-color: var(--fb-green); color: var(--chrome-ink); background: var(--chrome-surface);
}
.step.is-complete .step-dot { background: var(--fb-green); border-color: var(--fb-green); }
.step.is-complete .step-num { display: none; }
.step.is-complete .step-check { display: block; }
.step-label { font-size: 12.5px; font-weight: 600; color: var(--chrome-ink-soft); white-space: nowrap; }
.step.is-current .step-label { color: var(--chrome-ink); }
.step.is-skipped { display: none; }
.topbar .step-btn:focus-visible { outline-color: var(--fb-green); }

.topbar-actions { display: flex; gap: 4px; flex: none; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: transparent; color: var(--chrome-ink-soft);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: var(--chrome-surface); color: var(--chrome-ink); }

/* ---------- Screens ---------- */
.screen { flex: 1; display: flex; }
.screen[hidden] { display: none; }

/* ---------- Sign-in (FairBill navy hero) ---------- */
.screen-signin {
  align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(900px 480px at 15% -10%, rgba(120, 162, 47, .22), transparent 60%),
    radial-gradient(700px 420px at 100% 110%, rgba(120, 162, 47, .14), transparent 60%),
    var(--signin-ground, var(--fb-navy));
}
/* on dark the page ground goes deeper than the card, so the card still reads
   as the lit surface it is on light */
html[data-theme="dark"] { --signin-ground: #01101d; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] { --signin-ground: #01101d; } }
.signin-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 32px 32px 30px; text-align: center;
  border-top: 5px solid var(--fb-green);
}
.signin-wordmark { display: block; height: 44px; width: auto; margin: 0 auto 18px; }
.signin-wordmark-dark { display: none; }
html[data-theme="dark"] .signin-wordmark-light { display: none; }
html[data-theme="dark"] .signin-wordmark-dark { display: block; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .signin-wordmark-light { display: none; }
  html[data-theme="auto"] .signin-wordmark-dark { display: block; }
}
.signin-mark {
  width: 48px; height: 48px; border-radius: 14px; margin: 0 auto 12px;
  background: var(--surface-2); color: var(--partner-accent);
  box-shadow: inset 0 0 0 1.5px var(--partner-accent);
  display: flex; align-items: center; justify-content: center;
}
.signin-card h1 { font-size: 20px; margin-bottom: 8px; color: var(--fb-navy); }
html[data-theme="dark"] .signin-card h1, html[data-theme="auto"] .signin-card h1 { color: var(--ink); }
.signin-sub {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); margin: -4px 0 10px;
}
.signin-lede { color: var(--ink-soft); font-size: 14px; line-height: 1.5; margin-bottom: 24px; }
.signin-logo { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.signin-card form { text-align: left; }
.signin-card #signin-slug-note { margin-bottom: 16px; }
.signin-remember-line { padding: 2px 0 12px; font-size: 13px; }
.signin-restoring {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 18px 0 8px; color: var(--ink-soft); font-size: 14px;
}
.signin-restoring[hidden] { display: none; }
.signin-restoring-spinner { display: block; width: 22px; height: 22px; color: var(--accent); }
.signin-foot { margin-top: 20px; font-size: 12px; color: var(--ink-faint); line-height: 1.5; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 14.5px; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent-fill); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { box-shadow: var(--shadow-md); background: color-mix(in srgb, var(--accent-fill) 88%, #000); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.btn-block { width: 100%; }
.btn.is-loading .btn-label { visibility: hidden; }
.btn.is-loading .icon-spin { display: block; position: absolute; }
.btn { position: relative; }

.link-btn {
  background: none; border: none; color: var(--accent); font-weight: 600; font-size: 13px;
  cursor: pointer; padding: 4px 6px; border-radius: 6px;
}
.link-btn:hover { background: var(--accent-soft); }

.input-action {
  border: none; background: none; color: var(--ink-faint); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; flex: none;
}
.input-action:hover { color: var(--ink); background: var(--surface-2); }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.optional { font-weight: 400; color: var(--ink-faint); }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="search"], input[type="date"], input[type="number"], select {
  height: 44px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--surface); color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  width: 100%;
}
select { appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolyline points='5.5 9 12 15.5 18.5 9' fill='none' stroke='%238a909b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
input:hover, select:hover { border-color: var(--ink-faint); }
input:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--bad); }
input[aria-invalid="true"]:focus, select[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px var(--bad-soft); }
input::placeholder { color: var(--ink-faint); }
input:disabled, select:disabled { opacity: .55; cursor: not-allowed; }

.input-with-action { position: relative; display: flex; align-items: center; }
.input-with-action input { padding-right: 44px; }
.input-with-action .input-action { position: absolute; right: 5px; }
.input-icon { position: absolute; right: 14px; color: var(--ink-faint); pointer-events: none; }

.field-msg { font-size: 12.5px; min-height: 0; color: var(--ink-faint); line-height: 1.5; }
.field-msg:empty { display: none; }
.field-msg-error { color: var(--bad); font-weight: 600; }
.field-msg-hint { color: var(--ink-faint); }
.field-msg-shield { display: flex; align-items: flex-start; gap: 6px; background: var(--accent-soft); color: var(--ink-soft); padding: 10px 12px; border-radius: var(--radius-sm); margin-top: 4px; }
.field-msg-shield .icon { color: var(--accent); margin-top: 1px; }

.field-group { border: none; padding: 0; margin: 0 0 28px; min-width: 0; }
.field-group legend { font-size: 13px; font-weight: 700; color: var(--ink); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; padding: 0; }
.field-group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.field-group-head legend { margin-bottom: 0; }

.grid { display: grid; gap: 16px 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-addr { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field-span-2 { grid-column: span 2; }
@media (max-width: 620px) {
  .grid-2, .grid-addr { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: span 1; }
}

/* ---------- Segmented control (enrollment type) ---------- */
.segmented {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 999px; margin-bottom: 10px;
}
.segment { position: relative; display: inline-flex; cursor: pointer; }
.segment input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segment-label {
  padding: 8px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  color: var(--ink-soft);
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
.segment:hover .segment-label { color: var(--ink); }
.segment input:checked + .segment-label {
  background: var(--accent-fill); color: var(--accent-ink); box-shadow: var(--shadow-sm);
}
.segment input:focus-visible + .segment-label { outline: 2.5px solid var(--accent); outline-offset: 2px; }
#contract-end-field { margin-top: 14px; max-width: 320px; }

/* ---------- Toggle switch ---------- */
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track {
  width: 36px; height: 21px; border-radius: 999px; background: var(--border);
  position: relative; transition: background-color var(--dur-fast) var(--ease); flex: none;
}
.toggle-thumb {
  position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform var(--dur-med) var(--ease);
}
.toggle input:checked + .toggle-track { background: var(--accent-fill); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(15px); }
.toggle input:focus-visible + .toggle-track { outline: 2.5px solid var(--accent); outline-offset: 2px; }

/* ---------- Checkbox line ---------- */
.checkbox-line {
  display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.5;
  color: var(--ink-soft); cursor: pointer; padding: 12px 0;
}
.checkbox-line input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--accent); flex: none; }

/* ---------- Finder ---------- */
.finders { display: grid; gap: 12px; margin-bottom: 28px; }
.finders .finder { margin-bottom: 0; }
.finder { margin-bottom: 28px; border: 1.5px dashed var(--border); border-radius: var(--radius-md); overflow: hidden; }
.finder-toggle {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  background: var(--surface-2); border: none; cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink);
}
.finder-hint { font-weight: 400; color: var(--ink-faint); font-size: 12px; margin-left: 2px; }
.finder-chevron { margin-left: auto; transition: transform var(--dur-fast) var(--ease); color: var(--ink-faint); }
.finder-toggle[aria-expanded="true"] .finder-chevron { transform: rotate(180deg); }
.finder-panel { padding: 16px; border-top: 1px solid var(--border); background: var(--surface); }
.search-status { min-height: 18px; margin-bottom: 4px; }
.search-results { max-height: 260px; overflow-y: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.search-results:empty { display: none; }
.search-result {
  padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover, .search-result.is-active { background: var(--accent-soft); }
.search-result-name { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.result-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-faint);
  border: 1px solid var(--border); flex: none;
}
.result-tag-archived { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.search-result-meta { font-size: 12px; color: var(--ink-faint); }

/* ---------- Enrollment option cards ---------- */
.enroll-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 12px; }
@media (max-width: 620px) { .enroll-options { grid-template-columns: 1fr; } }
.option-card {
  position: relative; display: flex; gap: 14px; align-items: flex-start;
  border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 18px;
  cursor: pointer; background: var(--surface);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.option-card:hover { border-color: var(--ink-faint); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.option-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option-card-icon {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  background: var(--surface-2); color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
}
.option-card-body { display: flex; flex-direction: column; gap: 3px; padding-right: 20px; }
.option-card-title { font-weight: 700; font-size: 15px; }
.option-card-desc { font-size: 12.5px; color: var(--ink-faint); line-height: 1.45; }
.option-card-check {
  position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center;
  color: transparent; transition: all var(--dur-fast) var(--ease);
}
.option-card:has(input:checked) {
  border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset;
}
.option-card:has(input:checked) .option-card-icon { background: var(--accent-fill); color: var(--accent-ink); }
.option-card:has(input:checked) .option-card-check { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); }
.option-card-check .icon { width: 12px; height: 12px; }
/* the IronHorse leg wears IronHorse's colors */
.option-card-ironhorse:has(input:checked) {
  border-color: var(--ih-navy); background: var(--ih-gold-soft); box-shadow: 0 0 0 1px var(--ih-navy) inset;
}
.option-card-ironhorse:has(input:checked) .option-card-icon { background: var(--ih-navy); color: var(--ih-gold); }
.option-card-ironhorse:has(input:checked) .option-card-check { background: var(--ih-gold); border-color: var(--ih-gold); color: var(--ih-navy); }
html[data-theme="dark"] .option-card-ironhorse:has(input:checked),
html[data-theme="auto"] .option-card-ironhorse:has(input:checked) { border-color: var(--ih-gold); box-shadow: 0 0 0 1px var(--ih-gold) inset; }
.option-card-brand { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
.option-card-fairbill .option-card-brand { color: var(--fb-green-text); }
.option-card-ironhorse .option-card-brand { color: var(--ih-navy); }
html[data-theme="dark"] .option-card-ironhorse .option-card-brand, html[data-theme="auto"] .option-card-ironhorse .option-card-brand { color: var(--ih-gold); }

/* ---------- IronHorse panel: the vendor's wordmark strip ---------- */
.ihp-brand {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--ih-navy); color: #ffffff;
  border-left: 5px solid var(--ih-gold);
}
.ihp-brand-mark {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--ih-gold); color: var(--ih-navy);
  display: flex; align-items: center; justify-content: center;
}
.ihp-brand-mark .icon { width: 20px; height: 20px; }
.ihp-brand-name { display: flex; flex-direction: column; line-height: 1.1; }
.ihp-brand-name strong { font-size: 16px; letter-spacing: -.01em; }
.ihp-brand-name span { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ih-gold); }
.ihp-brand-note { margin-left: auto; font-size: 12px; color: rgba(255, 255, 255, .78); text-align: right; }
#panel-ironhorse .plan-card:has(input:checked), #panel-ironhorse .campaign-card:has(input:checked) {
  border-color: var(--ih-navy); background: var(--ih-gold-soft);
}
html[data-theme="dark"] #panel-ironhorse .plan-card:has(input:checked), html[data-theme="auto"] #panel-ironhorse .plan-card:has(input:checked),
html[data-theme="dark"] #panel-ironhorse .campaign-card:has(input:checked), html[data-theme="auto"] #panel-ironhorse .campaign-card:has(input:checked) { border-color: var(--ih-gold); }
#panel-ironhorse .campaign-card input, #panel-ironhorse .checkbox-line input { accent-color: var(--ih-navy); }

/* ---------- Reveal panels ---------- */
.reveal-panel {
  animation: reveal var(--dur-med) var(--ease);
  border-top: 1px solid var(--border); padding-top: 24px; margin-top: 8px;
}
@keyframes reveal { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.price-line {
  display: flex; align-items: center; gap: 10px; background: var(--good-soft); color: var(--good);
  padding: 14px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 24px;
}
.price-line strong { font-size: 15px; }

/* ---------- Campaign cards ---------- */
.campaign-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.campaign-card {
  display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.campaign-card:hover { border-color: var(--ink-faint); }
.campaign-card input { accent-color: var(--accent); width: 17px; height: 17px; flex: none; }
.campaign-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.campaign-card-body { display: flex; flex-direction: column; gap: 2px; }
.campaign-card-title { font-weight: 600; font-size: 13.5px; }
.campaign-card-desc { font-size: 12px; color: var(--ink-faint); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--border); margin-bottom: 24px; }
.tab {
  background: none; border: none; padding: 10px 4px; margin-right: 20px; font-weight: 600; font-size: 14px;
  color: var(--ink-faint); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1.5px;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.tab[aria-selected="true"] { color: var(--ink); border-color: var(--accent); }
.tabpanel[hidden] { display: none; }

/* ---------- Slide viewport & transitions ---------- */
.screen-enroll { flex-direction: column; align-items: stretch; }
.slide-viewport {
  flex: 1; max-width: 780px; width: 100%; margin: 0 auto; padding: 32px 20px 140px;
  position: relative;
}
.slide {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 32px clamp(20px, 4vw, 40px);
}
.slide[hidden] { display: none; }
.slide.is-entering { animation: slide-in var(--dur-med) var(--ease); }
@keyframes slide-in {
  from { opacity: 0; transform: translateX(var(--enter-x, 16px)); }
  to { opacity: 1; transform: translateX(0); }
}
.slide-head { margin-bottom: 28px; }
.slide-head h2 { font-size: 20px; display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.slide-head h2 .icon { color: var(--fb-green-text); }
html[data-theme="dark"] .slide-head h2 .icon, html[data-theme="auto"] .slide-head h2 .icon { color: var(--accent); }
.slide-head h2 { color: var(--fb-navy); }
html[data-theme="dark"] .slide-head h2, html[data-theme="auto"] .slide-head h2 { color: var(--ink); }
.slide-sub { color: var(--ink-faint); font-size: 13.5px; }

/* ---------- Review ---------- */
.review-card { padding: 20px 0; border-top: 1px solid var(--border); }
.review-card:first-child { border-top: none; padding-top: 0; }
.review-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.review-card-head h3, .review-consent h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.review-lines { display: flex; flex-direction: column; gap: 10px; }
.review-line { display: flex; justify-content: space-between; gap: 16px; font-size: 13.5px; }
.review-line dt { color: var(--ink-faint); }
.review-line dd { font-weight: 600; text-align: right; }
.review-consent { padding-top: 20px; }
.terms-details { margin: 12px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; }
.terms-details summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--accent); }
.terms-text { margin-top: 10px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; }
.terms-text p + p { margin-top: 8px; }

/* ---------- Leg results ---------- */
.leg-result-card {
  border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 16px; margin-bottom: 12px;
  border-left-width: 5px;
}
#result-fairbill .leg-result-card { border-left-color: var(--fb-green); }
#result-ironhorse .leg-result-card { border-left-color: var(--ih-gold); }
.leg-result-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.leg-result-title { font-weight: 700; font-size: 14px; flex: 1; }
.leg-result-icon { width: 20px; height: 20px; }
.leg-result-badge {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  padding: 3px 9px; border-radius: 999px;
}
.leg-result-message { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.leg-result-actions { margin-top: 12px; display: flex; gap: 10px; }
.leg-result-card.is-good { border-color: color-mix(in srgb, var(--good) 40%, var(--border)); }
.leg-result-card.is-good .leg-result-icon { color: var(--good); }
.leg-result-card.is-good .leg-result-badge { background: var(--good-soft); color: var(--good); }
.leg-result-card.is-bad { border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.leg-result-card.is-bad .leg-result-icon { color: var(--bad); }
.leg-result-card.is-bad .leg-result-badge { background: var(--bad-soft); color: var(--bad); }
.leg-result-card.is-warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); }
.leg-result-card.is-warn .leg-result-icon { color: var(--warn); }
.leg-result-card.is-warn .leg-result-badge { background: var(--warn-soft); color: var(--warn); }

/* ---------- Success ---------- */
.slide-success { display: flex; align-items: center; justify-content: center; }
.success-card { text-align: center; max-width: 420px; margin: 0 auto; }
.success-mark { color: var(--fb-green); display: inline-flex; margin-bottom: 16px; animation: pop var(--dur-med) var(--ease); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-card h2 { font-size: 22px; margin-bottom: 8px; }
.success-id { color: var(--ink-faint); font-size: 13.5px; margin-bottom: 24px; }
.success-id strong { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
#success-summary { text-align: left; margin-bottom: 28px; background: var(--surface-2); border-radius: var(--radius-md); padding: 16px 18px; }

/* ---------- Slide nav footer ---------- */
.slide-nav {
  position: sticky; bottom: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-top: 1px solid var(--border);
  padding: 14px 20px;
}
.slide-nav #nav-error { text-align: center; margin-bottom: 8px; }
.slide-nav-buttons { max-width: 780px; margin: 0 auto; display: flex; justify-content: space-between; gap: 12px; }
.slide-nav-buttons .btn-primary { margin-left: auto; }

/* ---------- Toasts ---------- */
.toast-region {
  position: fixed; top: 16px; right: 16px; z-index: 100;
  display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 32px));
}
.toast {
  background: var(--fb-navy); color: #ffffff; padding: 12px 16px; border-radius: var(--radius-sm);
  border-left: 4px solid var(--fb-green);
  box-shadow: var(--shadow-lg); font-size: 13.5px; line-height: 1.4;
  animation: toast-in var(--dur-med) var(--ease);
}
html[data-theme="dark"] .toast, html[data-theme="auto"] .toast { background: var(--surface-2); color: var(--ink); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.toast.is-error { background: var(--bad); color: #fff; border-left-color: #fff; }
.toast.is-good { background: var(--fb-green); color: #fff; border-left-color: #fff; }

/* ---------- Mock-payment banner (misconfigured deployment guard) ---------- */
.mock-banner {
  background: var(--bad); color: #fff; padding: 10px 16px; text-align: center;
  font-size: 13.5px; line-height: 1.4; position: sticky; top: 0; z-index: 90;
}

/* Fieldsets whose <legend> is followed by a toggle: the legend stays the
   fieldset's first child (accessible name); the toggle row sits right under
   it, pulled up to read as one header line. */
.field-group-head-toggle { justify-content: flex-end; margin-top: -30px; margin-bottom: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .progress-rail .step-label { display: none; }
  .topbar-inner { gap: 10px; }
}
@media (max-width: 560px) {
  .slide-viewport { padding: 20px 12px 150px; }
  .slide { padding: 22px 16px; border-radius: var(--radius-md); }
  .brand-sub { display: none; }
  .brand-divider, .brand-text { display: none; }
  .fb-wordmark { height: 22px; }
  .signin-card { padding: 28px 22px; }
  .ihp-brand-note { display: none; }
}

/* ---------- Plan cards (IronHorse /agent/plans) ---------- */
.plan-card .campaign-card-body { gap: 4px; }
.plan-card-links { font-size: 12.5px; color: var(--ink-soft); }
.plan-card-links a { color: var(--accent); text-decoration: none; }
.plan-card-links a:hover { text-decoration: underline; }
