/* pare.css: pare.mk design system (Apple HIG-inspired web language).
   Loaded LAST in <head>, so it wins over page-level <style> blocks for shared components.
   Rules and the anti-AI-look checklist: .claude/skills/pare-design/SKILL.md
   Light appearance only for now: templates still hard-code Tailwind light utilities. */

:root {
  color-scheme: light;
  /* Apple system colors (light) */
  --accent: #007AFF;
  --accent-pressed: #0062CC;
  --accent-tint: rgba(0, 122, 255, .12);
  --green: #34C759;  --green-ink: #1E7B34;  --green-tint: rgba(52, 199, 89, .14);
  --red: #FF3B30;    --red-ink: #C4281F;    --red-tint: rgba(255, 59, 48, .12);
  --orange: #FF9500; --orange-ink: #9A5B00; --orange-tint: rgba(255, 149, 0, .14);
  --bg-grouped: #F2F2F7;
  --bg-card: #FFFFFF;
  --label: #000000;
  --label-2: rgba(60, 60, 67, .60);
  --label-3: rgba(60, 60, 67, .30);
  --separator: rgba(60, 60, 67, .29);
  --separator-soft: rgba(60, 60, 67, .12);
  --fill: rgba(120, 120, 128, .12);
  --fill-2: rgba(120, 120, 128, .08);

  --r-control: 10px;
  --r-card: 14px;
  --r-sheet: 20px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .04), 0 0 0 .5px rgba(0, 0, 0, .04);
  --shadow-raised: 0 4px 16px rgba(0, 0, 0, .06), 0 0 0 .5px rgba(0, 0, 0, .05);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.25, .1, .25, 1);
}

/* ---------- Base ---------- */
html, body {
  font-family: var(--font) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body { background: var(--bg-grouped) !important; color: var(--label); font-size: 17px; line-height: 1.47; }
h1, h2, h3, .title { font-family: var(--font-display); color: var(--label); }
h1 { letter-spacing: -.022em; }
h2 { letter-spacing: -.012em; }
a { -webkit-tap-highlight-color: transparent; }
::selection { background: var(--accent-tint); }
.num, .hk-value, .tabular { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 3px solid rgba(0, 122, 255, .45); outline-offset: 2px; border-radius: 6px; }

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

/* Map legacy Tailwind accent utilities onto the single accent */
.text-sky-700, .text-sky-600, .text-brand, .nav-active { color: var(--accent) !important; }
.bg-slate-50 { background: var(--bg-grouped) !important; }
.muted, .text-slate-500, .text-slate-600 { color: var(--label-2) !important; }
.text-slate-400 { color: var(--label-2) !important; }
.border-slate-100, .border-slate-200 { border-color: var(--separator-soft) !important; }

/* ---------- Navigation bar (the only translucent material) ---------- */
.glass {
  background: rgba(249, 249, 249, .94) !important;
  border-bottom: .5px solid var(--separator) !important;
  box-shadow: none !important;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass { background: rgba(249, 249, 249, .78) !important; -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
}
.shadow-soft { box-shadow: none !important; }
.nav-link { color: var(--label); font-size: 15px; font-weight: 500; padding: .5rem .6rem; border-radius: 8px; min-height: 44px; white-space: nowrap; }
header nav .btn { white-space: nowrap; }
header nav .btn-ghost.text-sm { padding: 0 8px; min-width: 36px; font-size: 13px; }
.nav-link:hover { background: var(--fill-2); }
.nav-link:after { display: none !important; }
.nav-active { font-weight: 600; }
.menu-divider { background: var(--separator-soft) !important; height: .5px !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: 0 16px; border-radius: var(--r-control);
  font-size: 15px; font-weight: 600; letter-spacing: -.005em;
  border: 0; background: transparent; color: var(--accent);
  transition: background-color .15s var(--ease), opacity .15s var(--ease);
}
.btn:active { opacity: .7; }
.btn-primary, .btn-wide { background: var(--accent) !important; color: #fff !important; border: 0 !important; box-shadow: none !important; }
.btn-primary:hover, .btn-wide:hover { background: var(--accent-pressed) !important; }
.btn-ghost { background: transparent !important; color: var(--accent) !important; border: 0 !important; }
.btn-ghost:hover { background: var(--fill-2) !important; }
.btn-tinted { background: var(--accent-tint) !important; color: var(--accent) !important; }
.btn-sm, .btn-ghost-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn-wide { width: 100%; min-height: 50px; border-radius: 12px; font-size: 17px; font-weight: 600; }
.btn[disabled], .btn:disabled { opacity: .4; pointer-events: none; }

/* ---------- Surfaces ---------- */
.card {
  background: var(--bg-card) !important; border: 0 !important;
  border-radius: var(--r-card) !important; box-shadow: var(--shadow-card) !important;
}
.card.compact { box-shadow: var(--shadow-card) !important; }
.chip { background: var(--fill); color: var(--label); border-radius: 8px; font-size: 13px; padding: 4px 10px; }

/* Grouped list rows (Settings style) */
.group { background: var(--bg-card); border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow-card); }
.group-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 11px 16px; position: relative; }
.group-row + .group-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--separator); }
.group-row .k { color: var(--label); }
.group-row .v { color: var(--label-2); text-align: right; font-variant-numeric: tabular-nums; }
.section-title { font-size: 13px; font-weight: 400; text-transform: uppercase; letter-spacing: .02em; color: var(--label-2); margin: 24px 16px 8px; }
.section-foot { font-size: 13px; color: var(--label-2); margin: 8px 16px 0; }

/* ---------- Form controls ---------- */
.input, .select {
  width: 100%; min-height: 44px; border-radius: var(--r-control) !important;
  border: 0 !important; background: var(--fill) !important; color: var(--label);
  padding: 10px 14px !important; font-size: 17px !important; outline: none;
  transition: box-shadow .15s var(--ease), background-color .15s var(--ease);
}
.input::placeholder { color: var(--label-3); }
.input:focus, .select:focus { background: var(--bg-card) !important; box-shadow: 0 0 0 3px rgba(0, 122, 255, .35) !important; }
.lbl, .field label { font-size: 13px !important; color: var(--label-2) !important; font-weight: 500; }

/* Segmented control */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 2px; border-radius: 9px; background: var(--fill); width: 100%; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { display: grid; place-items: center; min-height: 36px; padding: 0 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--label); cursor: pointer; text-align: center; line-height: 1.15; transition: background-color .15s var(--ease); }
.segmented input:checked + label { background: var(--bg-card); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); font-weight: 600; }
.segmented input:focus-visible + label { outline: 3px solid rgba(0, 122, 255, .45); }

/* ---------- Badges ---------- */
.hk-badge, .badge {
  display: inline-flex; align-items: center; font-size: 12px !important; font-weight: 600; line-height: 1;
  padding: 4px 7px !important; border-radius: 6px !important; border: 0 !important;
  background: var(--fill) !important; color: var(--label-2) !important;
}
.hk-badge.success, .badge.green { background: var(--green-tint) !important; color: var(--green-ink) !important; }
.hk-badge.info, .badge.blue { background: var(--accent-tint) !important; color: var(--accent) !important; }
.hk-badge.sponsored, .badge.orange { background: var(--orange-tint) !important; color: var(--orange-ink) !important; }

/* ---------- Offer cards (results) ---------- */
#loanResults { gap: 10px !important; }
.hk-card {
  background: var(--bg-card) !important; border: 0 !important; border-radius: var(--r-card) !important;
  box-shadow: var(--shadow-card) !important; padding: 16px !important; gap: 16px !important;
}
.hk-card.super-offer { box-shadow: inset 0 0 0 1.5px var(--green), var(--shadow-card) !important; }
.hk-logo { border: 0 !important; background: var(--bg-card) !important; box-shadow: 0 0 0 .5px var(--separator-soft); border-radius: 12px !important; }
.hk-bank-name { font-weight: 600 !important; color: var(--label) !important; font-size: 16px; letter-spacing: -.01em; }
.hk-subtle { color: var(--label-2) !important; font-size: 13px !important; }
.hk-col .hk-label { color: var(--label-2) !important; font-size: 12px !important; font-weight: 500; }
.hk-col .hk-value { font-weight: 600 !important; font-size: 20px !important; color: var(--label) !important; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.hk-i { background: var(--fill) !important; color: var(--label-2) !important; }
.hk-tip { background: rgba(30, 30, 30, .94) !important; border-radius: 10px !important; box-shadow: var(--shadow-raised) !important; font-size: 13px !important; }
.cmp-link { border: 0 !important; background: var(--fill) !important; color: var(--label) !important; border-radius: 8px !important; font-weight: 500; }
.cmp-link.active { background: var(--accent) !important; color: #fff !important; }
.cmp-drawer { background: rgba(30, 30, 30, .92) !important; border-radius: 14px !important; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.smartbar { background: var(--bg-card) !important; border: 0 !important; box-shadow: var(--shadow-card); border-radius: 12px !important; }

/* ---------- Tables ---------- */
table thead { background: transparent !important; }
table thead th { color: var(--label-2); font-size: 12px; font-weight: 600; text-transform: none; }
table tbody tr { border-color: var(--separator-soft) !important; }

/* ---------- Footer ---------- */
footer { border-top: .5px solid var(--separator) !important; background: var(--bg-grouped); }
.social-icons a { border: 0 !important; background: var(--fill) !important; }
.social-icons a:hover { transform: none !important; background: var(--fill) !important; opacity: .75; }

/* ---------- Home ---------- */
.home-hero { max-width: 1080px; margin: 0 auto; padding: 48px 20px 16px; }
.home-hero h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.05; font-weight: 700; letter-spacing: -.03em; max-width: 14ch; }
.home-hero .lead { font-size: clamp(17px, 2vw, 21px); color: var(--label-2); max-width: 36ch; margin-top: 12px; }
.home-grid { display: grid; gap: 24px; }
.home-grid > * { min-width: 0; }
@media (min-width: 900px) { .home-grid { grid-template-columns: 1fr 420px; align-items: start; gap: 48px; } }
.search-sheet { background: var(--bg-card); border-radius: var(--r-sheet); box-shadow: var(--shadow-raised); padding: 20px; display: grid; gap: 14px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 28px; }
.fact { background: var(--bg-card); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 14px 16px; }
.fact .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fact .k { font-size: 13px; color: var(--label-2); margin-top: 2px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.logo-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.logo-tile { height: 64px; display: grid; place-items: center; background: var(--bg-card); border-radius: 12px; box-shadow: var(--shadow-card); padding: 10px; }
.logo-tile img { max-height: 40px; max-width: 100%; object-fit: contain; }
.logo-tile:hover { opacity: .8; }
.logo-name { font-size: 13px; font-weight: 600; color: var(--label); text-align: center; line-height: 1.2; }

/* ---------- Small screens (keep last) ---------- */
@media (max-width: 480px) {
  .segmented { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .home-hero { padding-top: 28px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts .fact.wide { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .hk-card { padding-top: 48px !important; }
}
