/* ==========================================================================
   iDovoz.sk public pages - base: reset, typography, page chrome
   All colours, sizes and spacing come from tokens.css (var(--...)).
   ========================================================================== */

/* --- Responsive layout tokens (values from the spacing scale) ------------- */
@media (min-width: 40em) {
  :root { --gutter: var(--sp-5); --card-pad-y: var(--sp-5); --card-pad-x: var(--sp-5); --flow-gap: var(--sp-4); --stack-gap: var(--sp-4); --main-pad-top: var(--sp-5); }
}
@media (min-width: 48em) {
  :root { --card-pad-y: var(--sp-6); --card-pad-x: var(--sp-6); --flow-gap: var(--sp-5); --main-pad-top: var(--sp-6); --main-pad-bottom: var(--sp-8); }
}

/* --- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-family: var(--font-sans);
  font-size: 100%;
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--footer-bg);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  font-size: var(--fs-base);
  overflow-wrap: break-word;
}
img, svg { display: block; max-width: 100%; }
svg { flex: none; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset { margin: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
ul, ol { padding-left: var(--sp-5); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--primary-tint-strong); color: var(--heading); }

/* --- Typography ----------------------------------------------------------- */
h1, .h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); font-weight: var(--fw-heading); letter-spacing: var(--ls-tight); color: var(--heading); text-wrap: balance; }
h2, .h2 { font-size: var(--fs-h2); line-height: var(--lh-tight); font-weight: var(--fw-heading); letter-spacing: var(--ls-heading); color: var(--heading); }
h3, .h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); font-weight: var(--fw-semibold); letter-spacing: var(--ls-snug); color: var(--heading); }
p, li { max-width: var(--measure); }
strong, b { font-weight: var(--fw-bold); }
small, .text-sm { font-size: var(--fs-sm); }
.text-muted { color: var(--text-muted); }
.lead { font-size: var(--fs-lg); line-height: var(--lh-snug); color: var(--text-muted); }

a { color: var(--link); text-decoration: underline; text-decoration-thickness: var(--border-w-thin); text-underline-offset: 0.2em; text-decoration-color: currentColor; }
a:hover { color: var(--link-hover); text-decoration-thickness: var(--border-w); }

/* --- Focus: always visible, never only colour ------------------------------- */
/* Controls: a 2 px white gap and a 2 px indigo ring (>= 6:1 against white and the page). */
:focus { outline: none; }
:focus-visible { outline: var(--focus-width) solid transparent; box-shadow: var(--focus-ring); border-radius: var(--radius-xs); }
/* Text links: indigo outline around a light indigo field, text in deep indigo (works on white, grey and tints). */
a:focus-visible {
  outline: var(--focus-width) solid var(--focus);
  outline-offset: var(--border-w);
  background: var(--focus-link-bg);
  color: var(--focus-link-fg);
  box-shadow: none;
  text-decoration: none;
  border-radius: var(--radius-xs);
}
/* Windows high-contrast / forced colours: fall back to a system outline. */
@media (forced-colors: active) {
  :focus-visible { outline: var(--focus-width) solid CanvasText; outline-offset: var(--border-w); }
}

/* --- Helpers -------------------------------------------------------------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.nowrap { white-space: nowrap; }
.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: var(--icon-stroke); stroke-linecap: round; stroke-linejoin: round; }
.icon--fill { fill: currentColor; stroke: none; }
.stack > * + * { margin-top: var(--stack-gap); }
/* The hidden fields at the start of a form (antiforgery token, the VIN) are not its first item. */
.stack > :nth-child(1 of :not([type="hidden"], [hidden])) { margin-top: 0; }

/* --- Skip link -------------------------------------------------------------- */
.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  padding: var(--sp-3) var(--sp-4); background: var(--primary); color: var(--on-primary);
  font-weight: var(--fw-semibold); text-decoration: underline; border-radius: var(--radius-button); box-shadow: var(--shadow-raised);
}
.skip-link:focus, .skip-link:focus-visible { top: var(--sp-2); outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-gap-width); background: var(--primary); color: var(--on-primary); }

/* --- No-JavaScript notice (instead of hiding the whole page) ---------------- */
.noscript-bar { background: var(--danger-tint); border-bottom: var(--border-w-thin) solid var(--danger-border); color: var(--danger-ink); padding: var(--sp-3) 0; font-weight: var(--fw-semibold); }

/* ==========================================================================
   Header: white band with a hairline, logo mark and two-part wordmark
   ========================================================================== */
.site-header { position: relative; background-color: var(--header-bg); background-image: var(--header-bg-image); color: var(--header-fg); border-bottom: var(--border-w-thin) solid var(--header-border); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 0 var(--sp-3); min-height: var(--header-h); flex-wrap: wrap; padding-block: var(--sp-1); }
@media (min-width: 48em) { .site-header__inner { min-height: var(--header-h-lg); } }

.brand {
  display: inline-flex; align-items: center; min-height: var(--target); padding-block: var(--sp-1); margin-left: calc(-1 * var(--sp-1)); padding-inline: var(--sp-1);
  font-family: var(--font-brand); font-size: var(--fs-brand); font-weight: var(--fw-bold); letter-spacing: var(--ls-tight); line-height: 1; text-decoration: none;
  color: var(--header-fg); border-radius: var(--radius-sm);
}
.brand__mark { display: var(--brand-mark-display, inline-block); width: 1.875rem; height: 1.875rem; margin-right: var(--sp-2-5); color: var(--brand-mark); }
.brand__name { color: var(--wordmark-name); }
.brand__tld { color: var(--wordmark-tld); font-weight: var(--fw-semibold); }
.brand:hover { color: var(--header-fg); }
.brand:focus-visible { background: transparent; outline: var(--focus-width) solid transparent; box-shadow: var(--focus-ring); color: var(--header-fg); }
@media (min-width: 48em) { .brand { font-size: var(--fs-brand-lg); } .brand__mark { width: 2.125rem; height: 2.125rem; } }

.nav-toggle {
  display: none; align-items: center; gap: var(--sp-2); min-height: var(--target); min-width: var(--target);
  padding: 0 var(--sp-3) 0 var(--sp-2-5); margin-right: calc(-1 * var(--sp-1));
  background: var(--btn-secondary-bg); color: var(--btn-secondary-fg); border: var(--border-w-thin) solid var(--btn-secondary-border); border-radius: var(--radius-button);
  font-weight: var(--fw-semibold); font-size: var(--fs-base); cursor: pointer; box-shadow: var(--shadow-xs);
  transition: background-color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
}
.nav-toggle:hover { background: var(--btn-secondary-bg-hover); border-color: var(--btn-secondary-border-hover); }
.nav-toggle:focus-visible { box-shadow: var(--focus-ring); }
.nav-toggle .icon { width: 1.375rem; height: 1.375rem; }
.nav-toggle[aria-expanded="true"] { background: var(--primary-tint); color: var(--info); border-color: var(--primary); }
.nav-toggle__close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__close { display: block; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 var(--sp-1); }
.site-nav a {
  position: relative; display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--target); padding: 0 var(--sp-3);
  color: var(--nav-fg); text-decoration: none; font-weight: var(--fw-medium); border-radius: var(--radius-sm);
  transition: background-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.site-nav a:hover { background: var(--nav-hover-bg); color: var(--heading); text-decoration: none; }
/* current page: a light indigo pill with deep indigo text (7.45:1) - not colour alone: aria-current + the pill shape */
.site-nav a[aria-current="page"] { background: var(--nav-current-bg); color: var(--nav-current); font-weight: var(--fw-semibold); }
.site-nav a:focus-visible { background: var(--focus-link-bg); color: var(--focus-link-fg); outline: var(--focus-width) solid var(--focus); outline-offset: 0; box-shadow: none; text-decoration: none; }
.site-nav .icon { width: 1.25rem; height: 1.25rem; }
@media (min-width: 48em) {
  .site-nav__home-label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .site-nav a { min-width: var(--target); justify-content: center; }
}

/* Phones and small tablets: the menu collapses behind a real button - only when scripting is on.
   Without JavaScript the links simply wrap under the logo. */
@media (max-width: 47.99em) {
  .site-nav { width: 100%; }
  .site-nav ul { padding-bottom: var(--sp-2); }
}
@media (max-width: 47.99em) and (scripting: enabled) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; }
  .site-nav.is-open { display: block; }
  .site-nav.is-open ul { flex-direction: column; gap: var(--sp-0-5); padding: var(--sp-2) 0 var(--sp-3); border-top: var(--border-w-thin) solid var(--border); }
  .site-nav.is-open a { width: 100%; min-height: var(--control-h); padding: 0 var(--sp-3); color: var(--text); }
  .site-nav.is-open a[aria-current="page"] { background: var(--nav-current-bg); color: var(--nav-current); }
}

/* --- Service line on information pages (tagline [MainSubheader2]) ----------- */
.service-bar { background: var(--vehicle-bar-bg); border-bottom: var(--border-w-thin) solid var(--vehicle-bar-border); }
.service-bar__inner { padding-block: var(--sp-3); font-size: var(--fs-sm); color: var(--text-muted); line-height: var(--lh-snug); }
.service-bar__inner p { padding-left: var(--sp-3); border-left: var(--border-w-thick) solid var(--primary-tint-border); }
.service-bar__inner strong { color: var(--heading); font-size: var(--fs-base); font-weight: var(--fw-semibold); letter-spacing: var(--ls-snug); display: block; }

/* ==========================================================================
   Vehicle bar: the VIN being processed, status, change link
   ========================================================================== */
.vehicle-bar { background: var(--vehicle-bar-bg); border-bottom: var(--border-w-thin) solid var(--vehicle-bar-border); box-shadow: var(--shadow-xs); }
.vehicle-bar__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 var(--sp-3); padding-block: var(--sp-1) var(--sp-3); }
.vehicle-bar__label { grid-column: 1; font-size: var(--fs-sm); color: var(--text-muted); font-weight: var(--fw-medium); line-height: var(--lh-tight); margin: 0; }
.vehicle-bar__change {
  grid-column: 2; grid-row: 1; justify-self: end; font-size: var(--fs-sm); font-weight: var(--fw-semibold); display: inline-flex; align-items: center; gap: var(--sp-1);
  min-height: var(--target); text-decoration: none; padding-inline: var(--sp-1); margin-right: calc(-1 * var(--sp-1));
}
.vehicle-bar__change:hover { text-decoration: underline; }
.vehicle-bar__change .icon { width: 1.05rem; height: 1.05rem; }
.vehicle-bar__main { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1-5) var(--sp-2-5); margin: 0; font-size: inherit; line-height: var(--lh-tight); letter-spacing: 0; }
/* A small car tile before the VIN from 30em (decorative). On phones the VIN and the status chip get the whole line. */
@media (min-width: 30em) {
  .vehicle-bar__main::before {
    content: ""; flex: none; width: 2.25rem; height: 2.25rem; border-radius: var(--radius-icon);
    background: var(--vehicle-icon-bg) url("img/icon-car.svg") center / 1.375rem no-repeat;
  }
}
@media (forced-colors: active) { .vehicle-bar__main::before { display: none; } }
@media (min-width: 48em) {
  .vehicle-bar__inner { padding-block: var(--sp-2) var(--sp-4); }
}

/* ==========================================================================
   Main area
   ========================================================================== */
.site-main { flex: 1 0 auto; padding-block: var(--main-pad-top) var(--main-pad-bottom); }
.site-main:focus { outline: none; }
.page-head { margin-bottom: var(--flow-gap); }
.page-head > * + * { margin-top: var(--sp-3); }
.flow > * + * { margin-top: var(--flow-gap); }

/* ==========================================================================
   Footer: operator, contacts, links
   ========================================================================== */
.site-footer { border-top: var(--border-w-thin) solid var(--footer-border, transparent); background: var(--footer-bg); color: var(--footer-fg); font-size: var(--fs-footer); line-height: var(--lh-snug); }
.site-footer a { color: var(--footer-fg-strong); text-decoration: none; }
.site-footer a:hover { color: var(--footer-fg-strong); text-decoration: underline; }
.site-footer a:focus-visible { color: var(--footer-fg-strong); background: transparent; outline: var(--focus-width) solid var(--focus-on-dark); outline-offset: var(--sp-0-5); }
.site-footer__top { padding-block: var(--sp-4) var(--sp-4-5); display: grid; gap: var(--sp-3); grid-template-columns: minmax(0, 1fr); grid-template-areas: "nav" "operator" "authority" "contact"; }
.site-footer__nav { grid-area: nav; }
.site-footer__operator { grid-area: operator; }
.site-footer__authority { grid-area: authority; }
.site-footer__contact { grid-area: contact; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-4); }
.site-footer__contact h2 { flex: 0 0 100%; }
.site-footer__operator, .site-footer__authority, .site-footer__contact { padding-top: var(--sp-3); border-top: var(--border-w-thin) solid var(--on-dark-divider); }
@media (min-width: 48em) {
  .site-footer__top { grid-template-columns: 1.1fr 1.3fr 1fr; grid-template-rows: auto 1fr; grid-template-areas: "nav operator contact" "nav authority contact"; column-gap: var(--sp-6); row-gap: var(--sp-4); padding-block: var(--sp-7) var(--sp-6); align-items: start; }
  .site-footer__contact { display: block; }
  .site-footer__operator, .site-footer__authority, .site-footer__contact { padding-top: 0; border-top: 0; }
}
.site-footer h2 { font-size: inherit; color: var(--footer-fg-strong); letter-spacing: 0; margin-bottom: var(--sp-0-5); font-weight: var(--fw-semibold); line-height: var(--lh-snug); }
.site-footer p { max-width: none; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0 var(--sp-5); }
@media (min-width: 48em) { .site-footer ul { flex-direction: column; } }
.site-footer li a { display: inline-flex; align-items: center; min-height: var(--target); font-weight: var(--fw-medium); }
.site-footer__brand { display: none; font-family: var(--font-brand); font-size: var(--fs-brand-footer); font-weight: var(--fw-bold); letter-spacing: var(--ls-tight); color: var(--footer-fg-strong); line-height: 1; margin: var(--sp-1) 0 var(--sp-3); }
.site-footer__brand span { color: var(--footer-wordmark-name); }
@media (min-width: 48em) { .site-footer__brand { display: block; } }
.site-footer__bottom { background: var(--footer-bottom-bg); padding-block: var(--sp-3); color: var(--footer-fg); }
.site-footer__bottom p { margin: 0; }
/* Simple centred footer */
.site-footer__simple { padding-block: var(--sp-5); display: grid; gap: var(--sp-2); justify-items: center; text-align: center; }
.site-footer__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 var(--sp-5); }
.site-footer__links a { display: inline-flex; align-items: center; min-height: var(--target); font-weight: var(--fw-medium); }
.site-footer__note { margin: 0; max-width: none; color: var(--footer-fg); }
.helpdesk { color: var(--footer-fg-strong); font-weight: var(--fw-semibold); user-select: all; }
