/*
 * auto-osiguranje.rs — licence-plate palette: plate white, SRB band blue, navy ink,
 * road-sign yellow reserved for "you are here" highlights.
 */
:root {
    color-scheme: light;
    --plate: #ffffff;
    --paper: #eef1f5;
    --band: #0c4da2;
    --band-dark: #083a7c;
    --ink: #17202e;
    --ink-soft: #4a5566;
    --rule: #d3d9e2;
    --signal: #f4c300;
    --signal-wash: #fff8d6;
    --flag-red: #c6363c;

    --font-plate: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --font-body: 'Barlow', system-ui, sans-serif;

    --step--1: 0.875rem;
    --step-0: 1.0625rem;
    --step-1: 1.25rem;
    --step-2: 1.625rem;
    --step-3: 2.25rem;
    --step-4: clamp(2.5rem, 6vw, 4.25rem);

    --gutter: 16px;
    --radius: 6px;
}

@media (min-width: 720px) {
    :root { --gutter: 32px; }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 var(--step-0)/1.55 var(--font-body);
    font-variant-numeric: tabular-nums;
}

h1, h2, h3 {
    font-family: var(--font-plate);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.005em;
    margin: 0 0 0.5em;
    text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); font-weight: 600; }

p { margin: 0 0 1em; }

a { color: var(--band); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--band-dark); text-decoration-thickness: 2px; }

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

[hidden] { display: none !important; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--ink-soft); }
.plain { list-style: none; margin: 0; padding: 0; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
    position: absolute; left: var(--gutter); top: -100px; z-index: 2000;
    background: var(--signal); color: var(--ink); padding: 8px 14px; font-weight: 600;
}
.skip-link:focus { top: 8px; }

/* Header */
.site-header { background: var(--plate); border-bottom: 1px solid var(--rule); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }

.brand { display: inline-flex; align-items: stretch; text-decoration: none; color: var(--ink); border: 2px solid var(--ink); border-radius: 5px; overflow: hidden; background: var(--plate); }
.brand:hover { color: var(--ink); }
.brand__band { background: var(--band); color: #fff; font: 600 0.6875rem/1 var(--font-plate); letter-spacing: 0.06em; padding: 0 6px; display: flex; align-items: flex-end; padding-bottom: 5px; }
.brand__name { font: 700 1.25rem/1 var(--font-plate); padding: 7px 10px 6px; letter-spacing: 0.01em; }
.brand__tld { color: var(--ink-soft); font-weight: 500; }

.site-nav { display: flex; gap: 20px; }
.site-nav a { font: 500 var(--step-0)/1 var(--font-plate); color: var(--ink); text-decoration: none; padding: 8px 0; }
.site-nav a:hover { color: var(--band); text-decoration: underline; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 8px 18px;
    font: 600 var(--step-0)/1.1 var(--font-plate); letter-spacing: 0.01em;
    color: var(--ink); background: var(--plate);
    border: 2px solid var(--ink); border-radius: var(--radius);
    text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--paper); color: var(--ink); text-decoration: none; }
.btn--primary { background: var(--band); border-color: var(--band); color: #fff; }
.btn--primary:hover { background: var(--band-dark); border-color: var(--band-dark); color: #fff; }
.btn--quiet { border-color: var(--rule); background: transparent; }
.btn:disabled { opacity: 0.55; cursor: default; }

/* Home: hero with the plate search — the one loud thing on the site */
.hero { background: var(--plate); padding: clamp(40px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--rule); }
.hero h1 { max-width: 15ch; }
.lede { font-size: var(--step-1); line-height: 1.45; max-width: 60ch; color: var(--ink-soft); }

.plate-form { position: relative; max-width: 640px; margin-top: 36px; }
.plate-form__label { display: block; font: 600 var(--step-1)/1.2 var(--font-plate); margin-bottom: 10px; }

.plate {
    display: flex; align-items: stretch;
    background: var(--plate);
    border: 4px solid var(--ink); border-radius: 12px;
    box-shadow: inset 0 0 0 3px var(--plate), inset 0 0 0 4px var(--rule);
    overflow: hidden;
}
.plate:focus-within { border-color: var(--band); }
.plate__band {
    flex: 0 0 auto; width: clamp(48px, 10vw, 64px);
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px;
    padding: 10px 0 10px;
    background: var(--band); color: #fff;
    font: 600 clamp(0.875rem, 2.4vw, 1.125rem)/1 var(--font-plate); letter-spacing: 0.08em;
}
.plate__flag { width: 26px; height: auto; border: 1px solid rgb(255 255 255 / 0.7); }
.plate__input {
    width: 100%;
    flex: 1 1 auto; min-width: 0;
    border: 0; background: transparent; color: var(--ink);
    font: 600 clamp(2rem, 8vw, 3.5rem)/1 var(--font-plate);
    letter-spacing: 0.06em; text-transform: uppercase;
    padding: 14px clamp(12px, 3vw, 24px) 12px;
}
.plate__input::placeholder { color: #b3bcc9; }
.plate__input:focus { outline: none; }

.plate-form__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.plate-form__status { min-height: 1.5em; margin-top: 12px; color: var(--ink-soft); }

.suggest {
    position: absolute; left: 0; right: 0; z-index: 1000;
    margin: 6px 0 0; padding: 6px 0; list-style: none;
    background: var(--plate); border: 2px solid var(--ink); border-radius: var(--radius);
    box-shadow: 0 12px 28px rgb(23 32 46 / 0.18);
}
.suggest [role=option] { display: flex; justify-content: space-between; gap: 16px; padding: 10px 16px; cursor: pointer; }
.suggest [role=option]:hover, .suggest [aria-selected=true] { background: var(--signal-wash); }
.suggest__name { font: 600 var(--step-1)/1.2 var(--font-plate); }
.suggest__counts { color: var(--ink-soft); font-size: var(--step--1); align-self: center; }
.suggest__none { padding: 10px 16px; color: var(--ink-soft); }

.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; }
@media (min-width: 1040px) { .hero__grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 64px; align-items: end; } }

.quick__head { font-size: var(--step-1); font-weight: 600; margin-bottom: 8px; }
.quick__table { width: 100%; border-collapse: collapse; }
.quick__table th, .quick__table td { padding: 8px 0; border-bottom: 1px solid var(--rule); text-align: right; }
.quick__table thead th { font: 500 var(--step--1)/1.2 var(--font-body); color: var(--ink-soft); border-bottom: 2px solid var(--ink); }
.quick__table tbody th { text-align: left; font: 600 var(--step-1)/1.2 var(--font-plate); }
.quick__table td { width: 7.5em; }
.quick__table td a { font-weight: 600; }
.quick__all { display: inline-block; margin-top: 12px; font-weight: 600; }

/* Home: steps to registration (a real sequence, so it is numbered) */
.steps { padding: clamp(48px, 7vw, 88px) 0; }
.steps__list { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 28px; counter-reset: step; }
@media (min-width: 860px) { .steps__list { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.steps__list li { counter-increment: step; border-top: 4px solid var(--ink); padding-top: 18px; }
.steps__list li::before {
    content: counter(step);
    display: block; margin-bottom: 10px;
    font: 700 3.25rem/1 var(--font-plate); color: var(--band);
}
.steps__list p { color: var(--ink-soft); max-width: 42ch; }

/* Home: city index */
.city-index { background: var(--plate); padding: clamp(48px, 7vw, 88px) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.letters { columns: 220px; column-gap: 40px; margin-top: 28px; }
.letter { break-inside: avoid; margin-bottom: 24px; }
.letter__head { font: 700 var(--step-2)/1 var(--font-plate); color: var(--band); margin: 0 0 6px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.cities { list-style: none; margin: 0; padding: 0; }
.cities li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--rule); }
.cities__name { color: var(--ink); text-decoration: none; font-weight: 500; }
.cities__name:hover { color: var(--band); text-decoration: underline; }
.cities__counts { white-space: nowrap; color: var(--ink-soft); font-size: var(--step--1); display: inline-flex; gap: 4px; }
.cities__counts a { color: var(--ink-soft); }
.cities__counts a:hover { color: var(--band); }

.notice { background: var(--signal-wash); border-left: 4px solid var(--signal); padding: 12px 16px; max-width: 70ch; }

/* Home: insurers */
.insurers { padding: clamp(48px, 7vw, 88px) 0; }
.insurer-list { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); column-gap: 40px; }
.insurer-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.insurer-list__brand { font: 600 var(--step-1)/1.2 var(--font-plate); }
.insurer-list a { font-size: var(--step--1); }

/* City and place pages */
.page-head { padding-top: 24px; padding-bottom: 8px; }
.page-head h1 { font-size: clamp(2.125rem, 5vw, 3.5rem); max-width: 22ch; }
.page-head .lede { margin-bottom: 20px; }

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0 0 18px; padding: 0; font-size: var(--step--1); color: var(--ink-soft); }
.crumbs li + li::before { content: '›'; margin: 0 8px; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); }
.crumbs [aria-current] { color: var(--ink); }

.kicker { font: 500 var(--step-1)/1.2 var(--font-plate); color: var(--ink-soft); margin-bottom: 8px; }

.kind-tabs { display: inline-flex; border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; background: var(--plate); margin-bottom: 8px; max-width: 100%; }
.kind-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; font: 600 var(--step-0)/1.1 var(--font-plate); color: var(--ink); text-decoration: none; }
.kind-tabs a + a { border-left: 2px solid var(--ink); }
.kind-tabs a:hover { background: var(--paper); }
.kind-tabs a[aria-current] { background: var(--ink); color: #fff; }
.count { font: 500 var(--step--1)/1 var(--font-body); color: inherit; opacity: 0.75; }

.listing { display: grid; gap: 24px; padding-top: 16px; padding-bottom: 64px; }
.listing__map { order: -1; }
@media (min-width: 960px) {
    .listing { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: start; }
    .listing__map { order: 0; position: sticky; top: 16px; }
}

.map { height: 320px; border: 2px solid var(--ink); border-radius: var(--radius); background: #dfe4ea; z-index: 0; }
@media (min-width: 960px) { .listing .map { height: calc(100vh - 32px); max-height: 820px; } }
.map--detail { height: 360px; }
@media (min-width: 960px) { .map--detail { height: 480px; } }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.toolbar__filter {
    flex: 1 1 220px; min-height: 46px; padding: 8px 14px;
    font: inherit; color: var(--ink); background: var(--plate);
    border: 2px solid var(--ink); border-radius: var(--radius);
}
.toolbar__filter:focus { outline: none; border-color: var(--band); box-shadow: 0 0 0 3px rgb(12 77 162 / 0.2); }
.toolbar__status { min-height: 1.4em; margin: 6px 0 4px; font-size: var(--step--1); color: var(--ink-soft); }

.insurer-group { margin-bottom: 32px; }
.insurer-group h2 { font-size: var(--step-2); display: flex; align-items: baseline; gap: 10px; margin: 0; padding: 10px 0 8px; border-bottom: 2px solid var(--ink); }

.places { list-style: none; margin: 0; padding: 0; background: var(--plate); border-radius: var(--radius); }
.place {
    display: grid; gap: 2px;
    padding: 14px 16px; border-bottom: 1px solid var(--rule);
    transition: background-color 120ms ease;
}
.place:last-child { border-bottom: 0; }
.place.is-active { background: var(--signal-wash); box-shadow: inset 4px 0 0 var(--signal); }
.place__name { font: 600 var(--step-1)/1.2 var(--font-plate); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.place__name:hover { color: var(--band); text-decoration: underline; }
.place .address { color: var(--ink); }
.place .phone { justify-self: start; }
.place .office-type { font-size: var(--step--1); color: var(--ink-soft); }
.place__meta { font-size: var(--step--1); color: var(--ink-soft); }
.place__distance { font: 600 var(--step--1)/1.3 var(--font-body); color: var(--band); }
.place__distance:empty { display: none; }
.place__insurer { display: none; }
.place.show-insurer .place__insurer { display: inline; color: var(--ink); font-weight: 600; }

.empty { padding-bottom: 72px; }
.empty p { max-width: 60ch; }
.nearby { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.nearby a { display: inline-block; padding: 8px 16px; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--plate); font: 600 var(--step-0)/1.1 var(--font-plate); color: var(--ink); text-decoration: none; }
.nearby a:hover { background: var(--ink); color: #fff; }

/* Place detail */
.detail { display: grid; gap: 28px; padding-top: 16px; padding-bottom: 72px; }
@media (min-width: 960px) { .detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; } }
.place-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.facts { display: grid; grid-template-columns: 1fr; margin: 0 0 20px; background: var(--plate); border-radius: var(--radius); padding: 4px 20px; }
.facts dt { font-size: var(--step--1); color: var(--ink-soft); padding-top: 12px; }
.facts dd { margin: 0; padding: 2px 0 12px; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.facts dd:last-of-type { border-bottom: 0; }
@media (min-width: 560px) {
    .facts { grid-template-columns: 180px 1fr; }
    .facts dt { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--rule); }
    .facts dd { padding: 12px 0; }
    .facts dt:last-of-type { border-bottom: 0; }
}
.source { font-size: var(--step--1); color: var(--ink-soft); }
.back::before { content: '‹ '; }

/* Footer */
.site-footer { background: var(--ink); color: #c9d1dc; padding: 48px 0 24px; font-size: var(--step--1); }
.site-footer a { color: #fff; }
.site-footer__inner { display: grid; gap: 28px; margin-bottom: 24px; }
@media (min-width: 720px) { .site-footer__inner { grid-template-columns: 1fr 1.4fr; gap: 48px; } }
.site-footer__brand { font: 700 var(--step-2)/1 var(--font-plate); color: #fff; margin-bottom: 10px; }
.site-footer__head { font: 600 var(--step-1)/1.2 var(--font-plate); color: #fff; margin-bottom: 8px; }
.site-footer li { padding: 3px 0; }
.attribution { border-top: 1px solid rgb(255 255 255 / 0.15); padding-top: 16px; margin: 0; }

/* Leaflet */
.leaflet-container { font: inherit; }
.leaflet-popup-content { font: 600 var(--step-0)/1.25 var(--font-plate); margin: 12px 16px; }
.leaflet-popup-content-wrapper { border-radius: var(--radius); }

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