/* ============================================================================
   LoneStarLower — UI primitives
   ----------------------------------------------------------------------------
   Buttons, inputs, chips, stepper, banners, cards. Tokens only — every value
   here is a var(--...) reference into tokens.css. This is the layer the
   address-entry component (Task 5) and the app retrofit (§9) build on.

   Content-page components (stat callout, data table, source attribution,
   distribution display, FAQ block, prose) are in content-components.css —
   Task 4 of the P0.5 brief, kept separate because they're a different
   vocabulary for a different surface (long-form content pages vs. the app's
   single-field screens).
============================================================================ */

@import url("./tokens.css");

/* ---------------------------------------------------------------------------
   Reset + base
--------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--surface-canvas);
  color: var(--ink-primary);
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

/* Visible focus rings everywhere — never outline:none (DESIGN_SYSTEM.md §8) */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
:focus:not(:focus-visible) { outline: none; }

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

/* ---------------------------------------------------------------------------
   Type
--------------------------------------------------------------------------- */
.lsl-h1, .lsl-h2, .lsl-h3, .lsl-h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tightest);
  margin: 0 0 var(--space-2);
}
.lsl-h1 { font-size: var(--text-3xl); }
.lsl-h2 { font-size: var(--text-2xl); }
.lsl-h3 { font-size: var(--text-xl); font-weight: var(--weight-bold); }
.lsl-h4 { font-size: var(--text-lg); font-weight: var(--weight-bold); letter-spacing: var(--tracking-tight); }

.lsl-lede {
  font-size: var(--text-lg);
  color: var(--ink-secondary);
  line-height: var(--leading-normal);
  margin: 0 0 var(--space-4);
}

.lsl-prose {
  max-width: var(--measure-prose);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--ink-primary);
}
.lsl-prose p { margin: 0 0 var(--space-4); }
.lsl-prose a {
  color: var(--brand-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.lsl-prose blockquote {
  margin: var(--space-4) 0;
  padding-left: var(--space-4);
  border-left: 3px solid var(--accent-gold);
  color: var(--ink-secondary);
}
.lsl-prose ul, .lsl-prose ol { padding-left: var(--space-5); margin: 0 0 var(--space-4); }
.lsl-prose li { margin-bottom: var(--space-2); }

/* Mono — labels, step indicators, chips, data tables, attribution, figures.
   Never body prose (DESIGN_SYSTEM.md §4: 800 words of mono prose is
   unreadable and hurts dwell time — the single most likely over-application
   of this aesthetic). */
.lsl-mono {
  font-family: var(--font-mono);
}
.lsl-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-1);
}

/* ---------------------------------------------------------------------------
   Surfaces
--------------------------------------------------------------------------- */
.lsl-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

/* ---------------------------------------------------------------------------
   Inputs
--------------------------------------------------------------------------- */
.lsl-input {
  width: 100%;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-raised);
  color: var(--ink-primary);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  min-height: var(--min-touch-target);
  transition: border-color var(--motion-base) var(--motion-ease);
}
.lsl-input:hover { border-color: var(--border-strong); }
.lsl-input:focus { border-color: var(--brand-primary); }
.lsl-input[aria-invalid="true"] { border-color: var(--state-error); }

/* ---------------------------------------------------------------------------
   Buttons — the §7.1 correction lives here.

   OLD (demo): default tone = --ink (near-black), disabled = --lineHard bg +
   white text, measured 1.53:1 — reads as washed-out/inactive even when the
   button IS the primary action (see contrast_check.py).

   NEW: the primary action is unmistakably --brand-primary (green) always —
   matching the brief's own §4 role definition ("brand-primary... primary
   CTA"). Verified 6.25:1, comfortably clears AA. The old default `ink` tone
   survives as .lsl-btn--secondary for genuinely lower-emphasis actions (e.g.
   the demo's PDF-export buttons). Disabled gets its OWN token pair
   (--cta-disabled-bg/-fg) distinct from both, so it can never again share a
   value with a border or an enabled state — verified 3.53:1, and WCAG 1.4.3
   exempts disabled controls from the AA floor entirely, but this still reads
   clearly rather than vanishing the way the old 1.53:1 pairing did.
--------------------------------------------------------------------------- */
.lsl-btn {
  display: block;
  width: 100%;
  padding: var(--space-4);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-tight);
  cursor: pointer;
  transition: background var(--motion-base) var(--motion-ease);
  min-height: var(--min-touch-target);
}
.lsl-btn--primary {
  background: var(--cta-bg);
  color: var(--cta-fg);
}
.lsl-btn--primary:hover:not(:disabled) { background: var(--cta-bg-hover); }
.lsl-btn--secondary {
  background: var(--cta-bg-secondary);
  color: var(--cta-fg);
}
.lsl-btn:disabled {
  background: var(--cta-disabled-bg);
  color: var(--cta-disabled-fg);
  cursor: default;
}

/* ---------------------------------------------------------------------------
   Chips — max three (DESIGN_SYSTEM.md §5). Copy runs through the compliance
   linter; short marketing fragments are exactly where implied guarantees
   hide. §7.3 replaces "2-minute result" (a performance promise nobody
   controls) with "No reduction, no charge" (the real differentiator) — that
   copy swap lives in the address-entry component (Task 5), not here; this is
   just the visual shape.
--------------------------------------------------------------------------- */
.lsl-chip-list {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.lsl-chip {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--brand-primary);
  background: var(--accent-soft);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Stepper — §7.4 correction: hidden until address resolution, not shown on
   first paint. The class exists here; the show/hide is a state the
   component using it controls (see address-entry.js) — a stepper announcing
   "STEP 1 / 6" to a cold visitor is a known drop-off trigger.
--------------------------------------------------------------------------- */
.lsl-stepper { display: none; }
.lsl-stepper.is-visible { display: flex; gap: var(--space-1); }
.lsl-stepper__segment {
  flex: 1;
  height: var(--space-1);
  border-radius: var(--radius-pill);
  background: var(--border-default);
  transition: background var(--motion-slow) var(--motion-ease);
}
.lsl-stepper__segment.is-complete,
.lsl-stepper__segment.is-current {
  background: var(--brand-primary);
}
.lsl-stepper__label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  letter-spacing: var(--tracking-wide);
  margin-top: var(--space-1);
}

/* ---------------------------------------------------------------------------
   Banners — coverage notices, validation, disclosure notes. One shape, three
   tones. Maps to the demo's CoverageNotice/ManualValueEntry pattern.
--------------------------------------------------------------------------- */
.lsl-banner {
  margin: var(--space-2) 0 var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}
.lsl-banner__title {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  margin-bottom: 3px;
}
.lsl-banner__body { color: var(--ink-secondary); }
.lsl-banner--error { background: var(--state-error-soft); }
.lsl-banner--success { background: var(--accent-soft); }
.lsl-banner--neutral {
  background: var(--surface-sunken);
  border: 1px solid var(--border-default);
}

/* ---------------------------------------------------------------------------
   Trust payload — §7.2 correction. Roughly 40% of the mobile viewport sat
   empty between chips and CTA in the demo. That space carries the trust
   payload: one-line methodology, source attribution, and the "no reduction,
   no charge" gate — not decoration, the actual credibility argument.
--------------------------------------------------------------------------- */
.lsl-trust-payload {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  font-size: var(--text-xs);
  color: var(--ink-secondary);
  background: var(--accent-soft);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  line-height: var(--leading-normal);
  margin: var(--space-3) 0;
}

/* ---------------------------------------------------------------------------
   Honeypot (added P1a) — hidden from sighted users AND screen readers
   (aria-hidden, tabindex="-1" in the markup), but still a real, visible-to-
   a-naive-scraper form field. The off-screen technique NEEDS literal pixel
   values to work reliably (display:none/visibility:hidden get skipped by
   some bots specifically because they're the well-known "obviously hidden"
   signal) — these are a documented bot-resistance technique, not a design
   token candidate, hence the lint-allow.
--------------------------------------------------------------------------- */
.lsl-honeypot {
  position: absolute; /* lint-allow: honeypot must be off-screen via literal px, not a token */
  width: 1px; height: 1px; /* lint-allow: honeypot must be off-screen via literal px, not a token */
  left: -9999px; /* lint-allow: honeypot must be off-screen via literal px, not a token */
  overflow: hidden;
}
