/* MDGSI design system — shared components.
   Import order: tokens.css, then this file, then the tool's own thin layer.

   Rules here are generic MDGSI styling only: page chrome, type, controls,
   cards, badges, callouts, plan blocks, and marketing components. Nothing
   in this file may reference an eligibility-specific concept or depend on
   one tool's markup. If a rule only makes sense for one tool, it belongs
   in that tool's layer, not here.

   A standalone reference of every component is in demo.html next to this
   file. Do not restyle components here without a ruling from Bill: the
   visual system is frozen (MDGSI_Shared_Visual_System_20260823_v2). */

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-interface);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* App shell: main grows so the footer sits at the viewport bottom. */
main {
  width: var(--container);
  margin: 0 auto;
  flex: 1;
}

/* ---------- Brand chrome ---------- */

/* Brand accent bar across the top of every MDGSI surface. */
.brand-bar {
  height: 5px;
  background: linear-gradient(90deg, var(--teal), var(--navy));
}

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  width: var(--container);
  margin: 0 auto;
  padding: var(--space-3) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand { display: inline-flex; align-items: center; }
.brand-logo { width: 140px; height: auto; display: block; }

.header-link {
  font-size: 14px;
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.header-link:hover { border-bottom-color: var(--teal); }

.header-contact { font-size: 14px; color: var(--muted); }
.header-contact a { color: var(--teal); font-weight: 600; text-decoration: none; }
.header-contact a:hover { text-decoration: underline; }

.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,.75);
  margin-top: var(--space-10);
}
.site-footer__inner {
  width: var(--container);
  margin: 0 auto;
  padding: var(--space-7) 0;
  font-size: 12.5px;
  line-height: 1.45;
}
.site-footer p { margin: 0 0 var(--space-3); }
.site-footer p:last-child { margin-bottom: 0; }

/* ---------- Type ---------- */

h1, h2, h3 { font-family: var(--font-display); color: var(--navy); margin: 0; }
h1, h2 { text-wrap: balance; } /* clean line breaks on long headings */

h1 { font-size: clamp(26px, 4vw, 34px); line-height: 1.2; font-weight: 600; }
h2 { font-size: clamp(20px, 3vw, 24px); line-height: 1.25; font-weight: 600; }
h3 { font-size: 18px; line-height: 1.3; font-weight: 600; }

.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 var(--space-2);
}

.subhead { font-size: 17px; color: var(--muted); margin: var(--space-2) 0 0; }

.hint { color: var(--muted); font-size: 13px; margin: var(--space-2) 0 0; }

/* ---------- Controls ---------- */

.field-label {
  display: block;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: var(--space-2);
}

input[type="text"], input[type="tel"], input[type="email"], select {
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-control);
  padding: 14px var(--space-4);
  width: 100%;
  min-height: 52px;
}

input[type="text"]:focus, input[type="tel"]:focus, input[type="email"]:focus, select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: var(--shadow-focus);
}

select { width: auto; min-width: 130px; }

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-control);
  padding: 14px var(--space-5);
  min-height: 48px;
  cursor: pointer;
  transition: background .2s ease, box-shadow .2s ease, color .2s ease;
}

.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.btn-primary {
  background: var(--teal);
  color: var(--white);
  border: 1.5px solid var(--teal);
  box-shadow: var(--shadow-action);
}
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); box-shadow: var(--shadow-action-h); }

.btn-secondary {
  background: var(--white);
  color: var(--teal);
  border: 1.5px solid var(--teal);
}
.btn-secondary:hover { background: var(--teal-soft); }

.btn-ghost {
  background: transparent;
  color: var(--teal);
  border: 1.5px solid transparent;
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}
.btn-ghost:hover { text-decoration: underline; }

.btn-block { display: block; width: 100%; }

/* Major CTA: the screen's one big action. Larger, arrowed, lifts on hover. */
.btn-cta-major {
  padding: 20px var(--space-6);
  font-size: 18px;
}
.btn-cta-major::after {
  content: " \2192";
  font-weight: 700;
  transition: transform .2s ease;
  display: inline-block;
}
.btn-cta-major:hover { transform: translateY(-1px); }
.btn-cta-major:hover::after { transform: translateX(4px); }

/* Brand-color headline accent (navy headline, teal key phrase). */
.headline-accent { color: var(--teal); }

/* ---------- Combobox with listbox ---------- */

.search-wrap { position: relative; }

.listbox {
  list-style: none;
  margin: var(--space-1) 0 0;
  padding: var(--space-1);
  position: absolute;
  left: 0; right: 0;
  z-index: 10;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-panel);
  max-height: 330px;
  overflow-y: auto;
}
.listbox[hidden] { display: none; }

.listbox li {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-control);
  cursor: pointer;
  font-size: 15px;
}
.listbox li .option-type { display: block; font-size: 12.5px; color: var(--muted); }
.listbox li:hover, .listbox li[aria-selected="true"] { background: var(--teal-soft); }

.no-match {
  padding: var(--space-4);
  font-size: 14px;
  color: var(--muted);
}
.no-match .btn { margin-top: var(--space-3); }

/* ---------- Step flow ---------- */

.progress {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--space-3);
}

/* Visual step progress: segmented track above the step label. */
.progress-track {
  display: flex;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
}
.progress-track span {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}
.progress-track .is-filled { background: var(--teal); }

/* Headings receive programmatic focus on screen changes; suppress the
   default ring for that case only (focus-visible styling is untouched). */
h1[tabindex="-1"]:focus { outline: none; }

.question { margin: var(--space-6) 0 0; }
.question:first-of-type { margin-top: var(--space-5); }

.choices { display: grid; gap: var(--space-2); margin-top: var(--space-3); }

.choice-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-control);
  padding: var(--space-3) var(--space-4);
  min-height: 52px;
  cursor: pointer;
  font-size: 15px;
  transition: border-color .2s ease, background .2s ease;
}
.choice-card:hover { border-color: var(--teal); }
.choice-card:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.choice-card:has(input:focus-visible) { box-shadow: var(--shadow-focus); }
.choice-card input { accent-color: var(--teal); width: 18px; height: 18px; margin: 0; flex: none; }

.date-row { display: flex; gap: var(--space-3); margin-top: var(--space-3); flex-wrap: wrap; }

.step-nav {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-7);
  align-items: center;
}

.field-error { color: var(--error); font-size: 14px; margin-top: var(--space-3); }
.field-error[hidden] { display: none; }

/* ---------- Cards, callouts, badges ---------- */

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
  margin-top: var(--space-5);
}

.badge {
  display: inline-block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: var(--radius-control);
  padding: 8px 14px;
  margin-bottom: var(--space-3);
}
.badge-positive { color: var(--positive); background: var(--positive-soft); }
.badge-neutral  { color: var(--muted); background: var(--cream); border: 1px solid var(--line); }
.badge-review   { color: var(--review); background: var(--review-soft); }

/* Callouts carry a faint full border in addition to the left bar so
   adjacent boxes read as distinct blocks, not one surface. */
.callout {
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--radius-card);
  padding: var(--space-4);
  margin: var(--space-5) 0 0;
  font-size: 15px;
}
.callout-closing { border-color: var(--attention-soft); border-left-color: var(--attention); }
.callout-final   { border-color: var(--error-soft); border-left-color: var(--error); }
.callout strong { display: block; margin-bottom: var(--space-1); }
.callout-suggested { border-left-color: var(--teal); background: var(--teal-soft); }
.callout-closing   { border-left-color: var(--attention); background: var(--attention-soft); }
.callout-closing strong { color: var(--attention); }
.callout-final     { border-left-color: var(--error); background: var(--error-soft); }
.callout-final strong { color: var(--error); }

/* ---------- Plan / result presentation ---------- */

.plan-block { border-top: 1px solid var(--line); padding-top: var(--space-5); margin-top: var(--space-5); }
.plan-block h3 { margin-bottom: var(--space-2); }
.plan-block p, .plan-block li { font-size: 15px; }
.plan-block ul { margin: var(--space-2) 0 0; padding-left: 20px; }
.plan-block li { margin-top: var(--space-1); }

.cta-group { margin-top: var(--space-5); }
.reassurance { font-size: 13.5px; color: var(--muted); margin-top: var(--space-3); }

.secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.result-disclosure { font-size: 13px; color: var(--muted); margin-top: var(--space-5); }

.review-list { margin: var(--space-2) 0 0; padding-left: 20px; font-size: 15px; }
.review-list li { margin-top: var(--space-1); }

/* ---------- Money ----------
 * The only sanctioned treatments for dollar figures. Values are rendered
 * through MDGSI_FORMAT.money(); never hand-format an amount. */

.amount-display { margin: var(--space-3) 0 0; }
.amount-display__value {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--navy);
}
.amount-display__unit {
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 2px;
}
.amount-display__caption {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: var(--space-1);
}

/* Inline figure inside body copy: "up to $8,000 per month" */
.amount-inline { font-weight: 700; color: var(--navy); white-space: nowrap; }

/* Benefit panel: the prominent positive box for a headline dollar figure. */
.amount-panel {
  background: var(--positive-soft);
  border: 1.5px solid var(--positive);
  border-radius: var(--radius-card);
  padding: var(--space-5);
  margin-top: var(--space-5);
}
.amount-panel h3 { color: var(--positive); margin-bottom: var(--space-2); }
.amount-panel p { margin: 0; font-size: 16px; }
.amount-panel .amount-panel__value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 700;
  color: var(--positive);
  margin: var(--space-2) 0;
}

/* Contact block: "Want to talk to Bill?" Call / Text / Email. */
.contact-block {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: var(--space-5);
  margin-top: var(--space-5);
}
.contact-block h3 { margin-bottom: var(--space-4); }
.contact-block .contact-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.contact-block .btn { padding: 18px var(--space-5); font-size: 17px; }
.contact-block--primary { border-color: var(--teal); box-shadow: var(--shadow-card); }
@media (max-width: 620px) {
  .contact-block .contact-actions { grid-template-columns: 1fr; }
}

/* Currency input: fixed $ prefix, numeric entry.
   <div class="input-currency"><span class="input-currency__prefix">$</span>
   <input type="text" inputmode="numeric"></div>
   Wire with MDGSI_FORMAT.attachCurrencyInput(); read with parseMoney(). */
.input-currency { position: relative; }
.input-currency__prefix {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  color: var(--muted);
  pointer-events: none;
}
.input-currency input { padding-left: calc(var(--space-4) + 16px); }

/* ---------- Lead form ---------- */

.lead-form {
  background: var(--white);
  border: 1.5px solid var(--teal);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
  margin-top: var(--space-5);
}
.lead-form .form-group { margin-top: var(--space-4); }
.lead-form .form-group:first-of-type { margin-top: 0; }
.lead-form button[type="submit"] { margin-top: var(--space-4); }

/* ---------- Expander / FAQ ---------- */

details {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  margin-top: var(--space-6);
}
details summary {
  cursor: pointer;
  font-weight: 600;
  padding: var(--space-4);
  color: var(--navy);
}
details .details-body { padding: 0 var(--space-4) var(--space-4); font-size: 15px; }

.faq-list details { margin-top: var(--space-2); }
.faq-list details:first-child { margin-top: var(--space-3); }

/* ---------- Marketing components ---------- */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.step-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: var(--space-4);
}
.step-card h3 { font-size: 16px; margin: var(--space-2) 0 var(--space-1); }
.step-card p { font-size: 14px; color: var(--muted); margin: 0; }

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 700;
  font-size: 14px;
}

.benefit-list {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  font-size: 15px;
}
.benefit-list li {
  position: relative;
  padding-left: 32px;
  margin-top: var(--space-2);
}
.benefit-list li::before {
  content: "\2713";
  position: absolute;
  left: 0; top: 1px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: var(--positive-soft);
  color: var(--positive);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.advisor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: var(--space-5);
}
.advisor-row h3 { margin-bottom: var(--space-1); }
.advisor-row p { font-size: 14px; color: var(--muted); margin: 0; }
.advisor-actions { display: flex; gap: var(--space-3); flex: none; }

/* ---------- Utility ---------- */

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

/* ---------- Breakpoints (shared tiers: 900 / 620 / 380) ---------- */

@media (max-width: 620px) {
  .brand-logo { width: 116px; }
  .card { padding: var(--space-4); }
  .step-nav { flex-direction: column-reverse; align-items: stretch; }
  .step-nav .btn { display: block; width: 100%; }
  .secondary-actions .btn { flex: 1 1 100%; }
  .steps-grid { grid-template-columns: 1fr; }
  .advisor-row { flex-direction: column; align-items: stretch; text-align: center; }
  .advisor-actions { flex-direction: column; }
}

@media (max-width: 380px) {
  body { font-size: 15px; }
}

/* ---------- Motion — visual system 1.8, non-negotiable ---------- */

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

/* ---------- Print ---------- */

@media print {
  .site-header, .step-nav, .secondary-actions, .btn, .listbox { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #999; }
}
