/* ============================================================
   LENDSCOPE — APP / COMPONENT STYLES
   Ported from Claude Design "LendScope" bundle (app.css).
   Prototype-only bits (proto-nav, tweaks-panel) stripped.
   Pair with tokens.css.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv02", "cv11";
}

body {
  font-size: 14px;
  line-height: 1.5;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* The logo anchor in every page's chrome wraps the rendered mark and never
   underlines. (Was style="text-decoration:none" on each page — the CSP's
   style-src carries no 'unsafe-inline', so inline attributes are blocked.) */
.logo-link, .logo-link:hover { text-decoration: none; }

/* Lender-mark tints — the homepage sample table and the panel-changes feed
   (js-free marketing pages, so the pair is a class, not a computed style). */
.tone-green    { background: #dcfce7; color: #166534; }
.tone-blue     { background: #dbeafe; color: #1e3a8a; }
.tone-red      { background: #fee2e2; color: #b91c1c; }
.tone-rose     { background: #fee2e2; color: #9f1239; }
.tone-orange   { background: #ffedd5; color: #c2410c; }
.tone-amber    { background: #fef3c7; color: #92400e; }
.tone-amber-dk { background: #fef3c7; color: #854d0e; }
.tone-grey     { background: #f3f4f6; color: #374151; }

/* ---------- TYPOGRAPHY ---------- */
.eyebrow {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
}
.eyebrow.muted { color: var(--neutral-text); }

h1, h2, h3, h4 { color: var(--text-1); margin: 0; font-weight: 700; line-height: 1.15; }
.h-hero    { font-size: 48px; letter-spacing: -1px; line-height: 1.05; }
.h-page    { font-size: 32px; letter-spacing: -.4px; }
.h-section { font-size: 24px; letter-spacing: -.2px; }
.h-card    { font-size: 20px; letter-spacing: -.1px; }
.h-sub     { font-size: 18px; font-weight: 600; }

p { margin: 0; color: var(--text-2); }
.lede { font-size: 18px; line-height: 1.6; color: var(--text-2); }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-h);
  padding: 0 18px;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.1px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-1);
  cursor: pointer;
  transition: background var(--tx-med), border-color var(--tx-med), color var(--tx-med), transform var(--tx-med);
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary   { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-secondary { background: var(--surface); color: var(--text-1); border-color: var(--border-medium); }
.btn-secondary:hover { background: var(--muted); }
.btn-ghost     { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--muted); color: var(--text-1); }
.btn-dark      { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.btn-dark:hover { opacity: .9; }
.btn-lg        { height: 48px; padding: 0 28px; font-size: 14px; border-radius: var(--r-md); }
.btn-sm        { height: 28px; padding: 0 10px; font-size: 11px; border-radius: var(--r-md); }
.btn-block     { width: 100%; }

/* ---------- INPUTS ---------- */
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: -.1px;
}
.input, .select {
  width: 100%;
  height: var(--input-h);
  padding: 0 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--r-md);
  background: var(--surface);
  font-family: inherit;
  font-size: 13px;
  color: var(--text-1);
  outline: none;
  transition: border-color var(--tx-med), box-shadow var(--tx-med);
}
.input:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 15%, transparent);
}
.input::placeholder { color: var(--text-3); }
.input.has-prefix { padding-left: 26px; }
.input-wrap { position: relative; }
.input-prefix {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--neutral-text);
  pointer-events: none;
}

/* Pill toggle */
.pill-toggle {
  display: flex;
  padding: 2px;
  background: var(--muted);
  border-radius: var(--r-md);
  gap: 0;
}
.pill-toggle button {
  flex: 1;
  height: 28px;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);   /* on the --muted track; --neutral-text is 4.4:1 there */
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--tx-med);
}
.pill-toggle button.active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* ---------- BADGES ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -.1px;
  border: 1px solid transparent;
}
.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge.pass    { background: var(--pass-bg);  color: var(--pass-text-aa); }
.badge.refer   { background: var(--refer-bg); color: var(--refer-text); }
.badge.fail    { background: var(--fail-bg);  color: var(--fail-text); }
.badge.neutral { background: var(--muted);    color: var(--text-2); }
.badge.no-dot::before { display: none; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tag.var { background: var(--accent-light); color: var(--accent); }
.tag.io  { background: #FEF3C7; color: #B45309; }
.tag.fix { background: #EDE9FE; color: #7C3AED; }

/* ---------- CARDS ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  padding: 28px;
}
.card-tight { padding: 16px; }

/* ---------- SECTIONS ---------- */
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}
.section { padding: var(--sec-pad-y) 0; }

/* ---------- LOGO ---------- */
.lendscope-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
}
.lendscope-logo .mark { flex: none; }
.lendscope-logo .wordmark {
  font-family: var(--font-sans);
  font-size: 18px;
  letter-spacing: -.4px;
  white-space: nowrap;
}
.lendscope-logo .wordmark .light { font-weight: 400; }
.lendscope-logo .wordmark .bold  { font-weight: 700; }

.lendscope-logo.on-dark           { color: #fff; }
.lendscope-logo.on-dark .ls-arc   { stroke: #fff; }
.lendscope-logo.on-dark .ls-dot   { fill: var(--accent); }

/* ---------- UTILS ---------- */
.row  { display: flex; align-items: center; gap: 12px; }
.col  { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; }
.dot-sep::before { content: "·"; margin: 0 8px; color: var(--text-3); }

.divider {
  height: 1px;
  background: var(--border-light);
  width: 100%;
}

/* ---------- TABLE ---------- */
.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.tbl thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--neutral-text);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.tbl tbody tr {
  height: var(--row-h);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--tx-fast);
}
.tbl tbody tr:hover { background: var(--muted); cursor: pointer; }
.tbl tbody td { padding: 8px 12px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }

/* ---------- AUTH CARD (login / signup) ---------- */
.auth-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 40px;
}
.auth-card {
  width: 460px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  padding: 48px 40px;
}

/* Keyboard focus ring (marketing + auth pages). :focus-visible = keyboard
   only, so mouse/touch users see no change. Nav links, CTAs and buttons
   had no focus indicator at all. */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible,
[tabindex]:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link — first focusable thing on every public page. Off-screen until
   it takes keyboard focus, then pinned top-left above the sticky nav. */
.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 100;
  padding: 10px 14px; border-radius: var(--r-md);
  background: var(--primary); color: var(--primary-fg);
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.skip-link:focus, .skip-link:focus-visible { top: 12px; outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── Touch targets (marketing / auth chrome) ────────────────
   App pages get a `pointer: coarse` rule from css/shared.css, but marketing,
   legal, comparison and aggregator pages load tokens.css + app.css
   (+ marketing-page.css) and never see it — so nothing here had a touch
   treatment at all. Measured on a phone: footer links rendered 15px tall,
   top-nav links 20px, all below the 24px WCAG 2.5.8 AA minimum and packed
   into an 8px-gap column where mis-taps are easy.

   Scoped to pointer:coarse so desktop spacing is untouched, and deliberately
   NOT applied to `.mp-body a` prose links — forcing a min-height on inline
   links inside paragraphs would break the text flow. Nav and footer links
   get 24px (AA) rather than 44px: 44px on a 20-item footer column would add
   ~580px of blank scroll for no real gain, whereas the standalone controls
   below are genuine buttons and take the full 44px. */
@media (pointer: coarse) {
  .dnav nav a,
  .dnav .login,
  .ft ul a,
  /* Standalone links that are the sole content of their line, so they are
     NOT covered by 2.5.8's inline-in-a-sentence exception: the pillar page's
     table-of-contents list (10 links stacked in an <ol>) and the contact
     cards, whose <p> holds nothing but the mailto link. */
  .mp-body .toc a,
  .mp-contact-card p a {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
  }
  .dnav .btn,
  .dnav .btn-primary,
  .mp-body a.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}
