/*
 * Komponentní vrstva. Staví výhradně na tokenech z tokens.css —
 * v tomhle souboru se nesmí objevit natvrdo zapsaná barva, rozestup ani rádius.
 */

/* ---------------------------------------------------------------- reset */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-5);
  line-height: var(--lh-5);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; text-wrap: balance; }
p, ul, ol { margin: 0; }
a { color: var(--gauge); text-decoration: none; }
a:hover { color: var(--gauge-strong); text-decoration: underline; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius-1);
}

.skip {
  position: absolute; left: var(--sp-4); top: calc(var(--sp-4) * -4);
  background: var(--ink); color: var(--action-on);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-2);
  z-index: 100; transition: top var(--dur-1) var(--ease-standard);
}
.skip:focus { top: var(--sp-4); }

/* ------------------------------------------------------------- rozvržení */

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--sp-9); }
.section--tight { padding-block: var(--sp-7); }
.section + .section { border-top: 1px solid var(--rule); }
.measure { max-width: var(--measure); }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.stack-lg { display: flex; flex-direction: column; gap: var(--sp-6); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: var(--sp-8);
}
.cols-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--sp-5); }
.cols-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-6); }

/* ------------------------------------------------------------- typografie */

.display { font-size: var(--text-hero); line-height: var(--lh-hero); letter-spacing: var(--tr-hero); font-weight: 900; }
.h1 { font-size: var(--text-1); line-height: var(--lh-1); letter-spacing: var(--tr-1); font-weight: 900; }
.h2 { font-size: var(--text-2); line-height: var(--lh-2); letter-spacing: var(--tr-2); font-weight: 700; }
.h3 { font-size: var(--text-3); line-height: var(--lh-3); letter-spacing: var(--tr-3); font-weight: 700; }
.lead { font-size: var(--text-4); line-height: var(--lh-4); color: var(--ink-2); }
.small { font-size: var(--text-6); line-height: var(--lh-6); }
.fine { font-size: var(--text-7); line-height: var(--lh-7); color: var(--ink-3); }
.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); }

.lbl {
  font-size: var(--text-label); line-height: var(--lh-label);
  font-weight: 600; letter-spacing: var(--tr-label); text-transform: uppercase;
}
.mono { font-family: var(--font-mono); }
.money {
  font-family: var(--font-display); font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.num { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- hlavička */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky; top: 0; z-index: 40;
}
.site-header .inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-5); min-height: 72px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 11px;
  color: var(--ink); text-decoration: none;
  /* Ochranná zóna podle brand manuálu: polovina výšky značky na všech stranách. */
  padding: 14px 0; margin: -14px 0;
}
.wordmark:hover { color: var(--ink); text-decoration: none; }
.wordmark svg { display: block; width: 28px; height: 28px; flex-shrink: 0; }

/* Název je rozdělený vahou, ne mezerou: cena · vozidla · .cz */
.wordmark .name {
  font-family: var(--font-display); font-size: 19px;
  letter-spacing: -0.012em; white-space: nowrap;
}
.wordmark .name .a { font-weight: 300; color: var(--ink-2); }
.wordmark .name .b { font-weight: 700; }
.wordmark .name .c { font-weight: 300; color: var(--ink-3); }

/* V patičce se odstíny berou z barvy textu, aby sestava držela v obou režimech. */
.site-footer .wordmark .name .a { color: inherit; opacity: .68; }
.site-footer .wordmark .name .c { color: inherit; opacity: .5; }
.nav { display: flex; align-items: center; gap: var(--sp-5); }
.nav a { color: var(--ink-2); font-size: var(--text-6); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: var(--sp-4); }

.nav-toggle { display: none; background: none; border: 1px solid var(--rule-strong); border-radius: var(--radius-2); padding: 10px 12px; cursor: pointer; }

/* --------------------------------------------------------------- tlačítka */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 44px; padding-inline: var(--sp-5);
  border-radius: var(--radius-2); border: 1px solid transparent;
  font-size: var(--text-6); font-weight: 600; text-decoration: none;
  cursor: pointer; text-align: center;
  transition: background var(--dur-1) var(--ease-standard), border-color var(--dur-1) var(--ease-standard), color var(--dur-1) var(--ease-standard);
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--action); color: var(--action-on); }
.btn--primary:hover { background: var(--action-hover); color: var(--action-on); }
.btn--primary:active { background: var(--action-active); }
.btn--secondary { border-color: var(--action-quiet-border); color: var(--ink); background: var(--surface); }
.btn--secondary:hover { background: var(--action-quiet-hover); color: var(--ink); }
.btn--quiet { color: var(--ink); background: transparent; }
.btn--quiet:hover { background: var(--action-quiet-hover); color: var(--ink); }
.btn--lg { min-height: 52px; padding-inline: var(--sp-6); font-size: var(--text-5); }
.btn--block { width: 100%; }
.btn[aria-disabled="true"], .btn:disabled { background: var(--rule-strong); border-color: var(--rule-strong); color: var(--surface); cursor: not-allowed; }
.btn--secondary[aria-disabled="true"] { background: transparent; color: var(--ink-3); border-color: var(--rule); }

/* ---------------------------------------------------- stupnice (signature) */

.gauge { display: block; width: 100%; height: auto; }

.gauge-readout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--rule-strong);
}
.gauge-readout > div { padding: var(--sp-5) var(--sp-5) var(--sp-3); border-right: 1px solid var(--rule); }
.gauge-readout > div:first-child { padding-left: 0; }
.gauge-readout > div:last-child { border-right: 0; padding-right: 0; }
.gauge-readout .k { color: var(--ink-3); margin-bottom: var(--sp-2); }
.gauge-readout .v { font-size: var(--money-xl); line-height: 1; color: var(--gauge); }
.gauge-readout .v--sm { font-size: var(--money-l); color: var(--ink); }

/* mini stupnice na společné škále 350–560 tis. Kč */
.mini-gauge { position: relative; height: 20px; background: var(--surface-low); }
.mini-gauge .band { position: absolute; inset-block: 0; left: 37.14%; width: 30.48%; background: var(--gauge-soft); }
.mini-gauge .tick { position: absolute; inset-block: 2px; width: 2px; background: var(--ink-2); }
.mini-gauge .tick--on { inset-block: 0; width: 3px; background: var(--gauge); }

/* -------------------------------------------------------------- cesty */

.path {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5);
  background: var(--surface); border: 1px solid var(--rule-strong);
  border-radius: var(--radius-3); padding: var(--sp-6);
  text-decoration: none; color: var(--ink);
  transition: border-color var(--dur-1) var(--ease-standard), background var(--dur-1) var(--ease-standard);
}
.path:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }
.path--primary { border-color: var(--ink); }
.path .arrow {
  flex-shrink: 0; width: 48px; height: 48px; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule-strong);
}
.path--primary .arrow { background: var(--action); border-color: var(--action); }

/* --------------------------------------------------------------- panely */

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-3);
  padding: var(--sp-6);
}
.panel--flush { padding: 0; overflow: hidden; }
.panel--accent { border-left: 3px solid var(--gauge); }

.note {
  border-left: 3px solid var(--gauge);
  background: var(--gauge-faint);
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--text-6); line-height: var(--lh-6);
}
.note--watch { border-left-color: var(--watch); background: var(--watch-soft); }
.note--risk { border-left-color: var(--risk); background: var(--risk-soft); }

/* ----------------------------------------------------------- cenové řádky */

.ladder { border-top: 1px solid var(--rule-strong); }
.ladder-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 260px) 140px;
  gap: var(--sp-5); align-items: baseline;
  padding-block: var(--sp-4); border-bottom: 1px solid var(--rule);
}
.ladder-row--key { background: var(--gauge-faint); padding-inline: var(--sp-3); margin-inline: calc(var(--sp-3) * -1); }
.ladder-row--key .name, .ladder-row--key .amount { color: var(--gauge); }
.ladder-row .name { font-weight: 600; }
.ladder-row .why { font-size: var(--text-6); color: var(--ink-2); }
.ladder-row .amount { text-align: right; font-size: var(--money-s); }

/* --------------------------------------------------------------- produkty */

.product {
  display: flex; flex-direction: column; gap: var(--sp-4);
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius-3); padding: var(--sp-6);
  position: relative;
}
.product--featured { border-color: var(--gauge); }
.product--featured::before {
  content: ""; position: absolute; inset-inline: -1px; top: -1px; height: 3px;
  background: var(--gauge); border-radius: var(--radius-3) var(--radius-3) 0 0;
}
.product--soon { background: transparent; border-style: dashed; }
.product .price { font-size: var(--money-l); line-height: 1; }
.product--featured .price { color: var(--gauge); }
.product ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.product li { font-size: var(--text-6); display: flex; gap: var(--sp-2); align-items: flex-start; }
.product li svg { flex-shrink: 0; margin-top: 4px; }

.badge {
  display: inline-block; padding: 3px 8px; border-radius: var(--radius-1);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
}
.badge--gauge { background: var(--gauge); color: var(--gauge-on); }
.badge--quiet { border: 1px solid var(--rule-strong); color: var(--ink-3); }

/* -------------------------------------------------------------- formulář */

.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.field > label { font-size: var(--text-6); font-weight: 600; }
.field .req { color: var(--risk); }
.field .help { font-size: var(--text-7); color: var(--ink-3); min-height: 1.45em; }
.field .help.is-error { color: var(--risk); }

.input, .select, .textarea {
  width: 100%; min-height: 48px;
  padding: 11px var(--sp-3);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--rule-strong); border-radius: var(--radius-2);
  font-family: var(--font-ui); font-size: var(--text-5);
  transition: border-color var(--dur-1) var(--ease-standard), box-shadow var(--dur-1) var(--ease-standard);
}
.textarea { min-height: 104px; resize: vertical; line-height: var(--lh-5); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--gauge); box-shadow: 0 0 0 3px var(--gauge-soft);
}
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--risk); border-width: 1.5px; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-2); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
  display: flex; flex-direction: column; gap: 3px;
  padding: var(--sp-3) var(--sp-4); min-height: 48px;
  border: 1px solid var(--rule-strong); border-radius: var(--radius-2);
  background: var(--surface); cursor: pointer;
  font-size: var(--text-6); font-weight: 600;
  transition: border-color var(--dur-1) var(--ease-standard), background var(--dur-1) var(--ease-standard);
}
.choice span em { font-style: normal; font-weight: 400; font-size: var(--text-7); color: var(--ink-3); }
.choice input:hover + span { border-color: var(--ink-2); }
.choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice input:checked + span { border-color: var(--gauge); border-width: 2px; background: var(--gauge-faint); padding: calc(var(--sp-3) - 1px) calc(var(--sp-4) - 1px); }
.choice input:checked + span, .choice input:checked + span em { color: var(--gauge); }

.summary {
  display: flex; flex-direction: column; gap: var(--sp-3);
  background: var(--surface-low); border-radius: var(--radius-3); padding: var(--sp-5);
}
.summary-row { display: flex; justify-content: space-between; gap: var(--sp-4); font-size: var(--text-6); }
.summary-row dt { color: var(--ink-2); }
.summary-row dd { margin: 0; font-weight: 600; text-align: right; }
.summary-total { border-top: 1px solid var(--rule-strong); padding-top: var(--sp-3); }

/* --------------------------------------------------------------- kroky */

.steps { counter-reset: step; }
.step-head { display: flex; align-items: center; gap: var(--sp-3); }
.step-head .n { font-family: var(--font-mono); font-size: var(--text-7); color: var(--gauge); }
.step-head .line { flex: 1; height: 1px; background: var(--rule); }

/* --------------------------------------------------------------- tmavý pruh */

.band-dark {
  background: var(--ink);
  color: var(--ink-inverse);
}
.band-dark h1, .band-dark h2, .band-dark h3 { color: var(--surface); }
.band-dark .muted, .band-dark p { color: var(--ink-inverse-2); }
.band-dark .lbl { color: var(--gauge); }
.band-dark .rule { border-top: 1px solid var(--rule-inverse); }

/* --------------------------------------------------------------- patička */

.site-footer { background: var(--ink); color: var(--ink-inverse); padding-block: var(--sp-7) var(--sp-6); }
.site-footer a { color: var(--ink-inverse-2); text-decoration: none; }
.site-footer a:hover { color: var(--surface); text-decoration: underline; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-8); padding-bottom: var(--sp-6); border-bottom: 1px solid var(--rule-inverse); }
.footer-cols { display: flex; flex-wrap: wrap; gap: var(--sp-8); }
.footer-col { display: flex; flex-direction: column; gap: var(--sp-2); }
.footer-col .lbl { color: var(--ink-3); margin-bottom: var(--sp-1); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-4); padding-top: var(--sp-5); }

/* ------------------------------------------------------------ responzivita */

@media (max-width: 1023px) {
  .split { grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); }
  .gauge-readout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gauge-readout > div { padding-inline: var(--sp-4); }
  .gauge-readout > div:nth-child(2n) { border-right: 0; }
  .ladder-row { grid-template-columns: minmax(0, 1fr) 120px; }
  .ladder-row .why { grid-column: 1 / -1; }
}

@media (max-width: 767px) {
  .nav, .header-actions .btn { display: none; }
  .nav-toggle { display: inline-flex; }
  .site-header .inner { min-height: 60px; }
  .nav.is-open {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    position: absolute; inset-inline: 0; top: 100%;
    background: var(--surface); border-bottom: 1px solid var(--rule-strong);
    padding: var(--sp-3) var(--gutter) var(--sp-4);
    box-shadow: var(--elev-menu);
  }
  .nav.is-open a { padding-block: var(--sp-3); border-bottom: 1px solid var(--rule); font-size: var(--text-5); }
  .nav.is-open a:last-child { border-bottom: 0; }
  .section { padding-block: var(--sp-7); }
  .path { padding: var(--sp-5); }
  .footer-cols { gap: var(--sp-6); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
