/* Financiatodo — design tokens · Bloom system */
:root {
  /* Neutral base — ink does the heavy lifting, paper is the stage */
  --bg: #FAFAF7;
  --bg-elev: #F2F0E9;
  --bg-card: #FFFFFF;
  --ink: #161616;
  --ink-2: #2A2A2A;
  --muted: #595959;
  --muted-2: #767676;
  --line: rgba(22,22,22,0.09);
  --line-2: rgba(22,22,22,0.16);

  /* Primary — ink black. Confident, quiet, lets the logo carry color. */
  --primary: #161616;
  --primary-2: #000000;
  --primary-soft: #F2F0E9;

  /* Accent — Bloom Yellow. Used sparingly: logo, "cost" highlight, one moment per screen. */
  --accent: #FFD400;
  --accent-2: #C9A800;
  --accent-soft: #FFF5B8;

  /* Secondary CTA — deep plum. Carries interaction when black feels too heavy. */
  --secondary: #3B1F6B;
  --secondary-2: #2B1550;
  --secondary-soft: #EEE8F8;

  /* Signal — leaf green. Reserved for success / approved only. */
  --signal: #00C271;
  --signal-2: #009E5A;
  --signal-soft: #D1F4E1;

  --danger: #E5484D;
  --success: var(--signal);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 2px rgba(22,22,22,0.04), 0 1px 1px rgba(22,22,22,0.03);
  --shadow: 0 4px 16px rgba(22,22,22,0.06), 0 1px 2px rgba(22,22,22,0.04);
  --shadow-lg: 0 16px 48px rgba(22,22,22,0.10), 0 2px 6px rgba(22,22,22,0.05);

  /* Type: single-face Inter Tight, tabular figures via OpenType */
  --sans: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --display: 'Inter Tight', system-ui, sans-serif;
  --mono: 'Inter Tight', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11';
  font-variant-numeric: tabular-nums;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; color: inherit; }

.serif, .display { font-family: var(--display); font-weight: 500; letter-spacing: -0.025em; }
.mono { font-family: var(--mono); }

/* Top nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
  background: rgba(247,245,240,0.82);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.nav__brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.025em; font-size: 17px; }
.nav__brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  overflow: hidden;
}
.nav__brand-mark svg { width: 100%; height: 100%; }
.nav__brand-text { font-size: 17px; color: var(--ink); letter-spacing: -0.025em; }
.nav__links { display: flex; gap: 28px; align-items: center; }
.nav__link { color: var(--muted); font-size: 14px; text-decoration: none; font-weight: 500; }
.nav__link:hover { color: var(--ink); }
.nav__actions { display: flex; gap: 10px; align-items: center; }
.lang-toggle {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; font-size: 12px;
  background: var(--bg-card);
}
.lang-toggle form { display: contents; margin: 0; }
.lang-toggle button { padding: 4px 10px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: 0.04em; }
.lang-toggle button.active { background: var(--primary); color: #fff; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 600; letter-spacing: -0.005em; transition: transform 0.1s ease, background 0.2s ease, box-shadow 0.2s ease; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-2); }
.btn--accent { background: var(--ink); color: var(--bg); }
.btn--accent:hover { background: #000; }
.btn--signal { background: var(--signal); color: #06281B; }
.btn--signal:hover { background: var(--signal-2); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn--ghost:hover { background: var(--bg-elev); border-color: var(--ink); }
.btn--lg { padding: 16px 26px; font-size: 15px; }
.btn--xl { padding: 18px 30px; font-size: 16px; }

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }

/* Inputs */
.input, .select {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-size: 15px;
  transition: border 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,60,58,0.12); }
.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); text-transform: none; }
.field__hint { font-size: 12px; color: var(--muted-2); }

/* Slider */
.slider-row { display: flex; flex-direction: column; gap: 10px; }
.slider-top { display: flex; justify-content: space-between; align-items: baseline; }
.slider-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.slider-value { font-family: var(--display); font-size: 30px; font-weight: 500; letter-spacing: -0.025em; line-height: 1; color: var(--ink); }
.slider-value small { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-left: 4px; font-weight: 500; letter-spacing: 0; }

input[type=range].range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; background: var(--line-2); border-radius: 999px; outline: none;
}
input[type=range].range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); cursor: grab;
  box-shadow: 0 2px 8px rgba(0,60,58,0.25), 0 0 0 4px var(--bg);
  transition: transform 0.15s ease;
}
input[type=range].range::-webkit-slider-thumb:hover { transform: scale(1.1); }
input[type=range].range::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); cursor: grab; border: none;
  box-shadow: 0 2px 8px rgba(0,60,58,0.25), 0 0 0 4px var(--bg);
}
.range-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted-2); margin-top: 2px; font-variant-numeric: tabular-nums; }

/* Progress pills */
.stepper { display: flex; gap: 8px; align-items: center; list-style: none; padding: 0; margin: 0 auto 24px; justify-content: center; }
.stepper__dot { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg-card); color: var(--muted); font-size: 12px; font-weight: 600; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.stepper__dot.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.stepper__dot.done { background: var(--signal-soft); color: var(--signal-2); border-color: var(--signal-soft); }
.stepper__line { flex: 0 0 28px; height: 1px; background: var(--line-2); }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--bg-card);
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--primary); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip.accent.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Utility */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }

/* Tweaks panel */
.tweaks {
  position: fixed; bottom: 20px; right: 20px; z-index: 100;
  width: 300px; background: var(--bg-card);
  border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 18px;
  font-size: 13px;
  display: none;
}
.tweaks.open { display: block; }
.tweaks h4 { margin: 0 0 14px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.tweaks__row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); gap: 10px; }
.tweaks__row:first-of-type { border-top: none; padding-top: 0; }
.tweaks__row label { color: var(--muted); font-weight: 500; }
.tweaks__swatches { display: flex; gap: 6px; }
.tweaks__swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.tweaks__swatch.active { border-color: var(--ink); }

.error-banner {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--danger); color: #fff; padding: 12px 18px;
  border-radius: var(--radius); font-size: 14px; font-weight: 500;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18); z-index: 1000; max-width: 90vw;
}
.error-banner[hidden] { display: none; }

/* Visually-hidden helper for screen-reader-only content */
.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: -40px; z-index: 1100;
  background: var(--ink); color: #fff; padding: 8px 14px;
  border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; }

/* Keyboard focus indicators */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-sm); }
.btn:focus-visible,
.chip:focus-visible,
.picker__tab:focus-visible,
.brand-card:focus-visible,
.model-row:focus-visible,
.lang-toggle button:focus-visible,
.nav__link:focus-visible,
.nav__brand:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.btn--primary:focus-visible,
.btn--signal:focus-visible {
  outline-color: var(--accent);
}
.range:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }

@media (max-width: 720px) {
  .nav { padding: 14px 18px; }
  .nav__links { display: none; }
}
