/* Používá se venku na parkovišti: velký kontrast, velká tlačítka, barvy jako reflexní vesta a asfalt. */
:root {
    --asphalt: #24282C;
    --concrete: #ECEEF0;
    --white: #FFFFFF;
    --hivis: #FFD21F;
    --eu-blue: #1E3FA8;
    --signal: #E0262F;
    --muted: #5E666E;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--concrete);
    color: var(--asphalt);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 17px;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;   /* v nainstalované aplikaci žádné „pružení“ stránky */
}


.topbar {
    background: var(--asphalt);
    padding: calc(14px + env(safe-area-inset-top)) 18px 14px;
    border-bottom: 6px solid var(--hivis);
}
.brand { color: var(--white); font-weight: 800; font-size: 1.25rem; text-decoration: none; }

.content { padding: 18px 16px calc(32px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }

h1 { font-size: 1.6rem; margin: 4px 0 16px; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }

.step {
    background: var(--white);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
    display: grid;
    gap: 12px;
}

/* Pole SPZ ve tvaru české značky */
.plate {
    display: flex;
    align-items: stretch;
    background: var(--white);
    border: 3px solid var(--asphalt);
    border-radius: 8px;
    overflow: hidden;
    height: 72px;
}
.plate-eu {
    background: var(--eu-blue);
    color: var(--white);
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-end;
    padding: 0 8px 8px;
}
.plate input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
    color: var(--asphalt);
}
.plate input::placeholder { color: #B8BDC2; }
.plate:focus-within { outline: 4px solid var(--hivis); outline-offset: 2px; }

/* Tlačítka */
.btn {
    width: 100%;
    min-height: 56px;
    border-radius: 12px;
    font: inherit;
    font-weight: 700;
    font-size: 1.1rem;
    border: 3px solid var(--asphalt);
    cursor: pointer;
}
.btn-primary { background: var(--hivis); color: var(--asphalt); }
.btn:disabled { opacity: 0.45; }
.btn:focus-visible, .map-toggle:focus-visible { outline: 4px solid var(--eu-blue); outline-offset: 2px; }


.hint { margin: 0; color: var(--muted); font-size: 0.95rem; }

.msg { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--white); font-weight: 600; }
.msg-error { border-left: 6px solid var(--signal); }

/* Načítání aplikace (než se spustí Blazor) */
.boot {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--asphalt);
    color: var(--white);
    font-weight: 700;
}

/* Výzva k instalaci na plochu */
.install {
    background: var(--white);
    border: 3px solid var(--hivis);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    display: grid;
    gap: 10px;
}
.install h2 { margin: 0; font-size: 1.15rem; }
.install p { margin: 0; }
.install-steps { margin: 0; padding-left: 1.4em; display: grid; gap: 6px; }
.install .link-btn { justify-self: start; margin-left: 0; color: var(--muted); }
.ios-share {
    display: inline-block;
    width: 14px;
    height: 16px;
    margin-left: 4px;
    vertical-align: -2px;
    border: 2px solid var(--eu-blue);
    border-top: 0;
    border-radius: 0 0 3px 3px;
    position: relative;
}
.ios-share::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -8px;
    width: 2px;
    height: 12px;
    background: var(--eu-blue);
    transform: translateX(-50%);
}

/* Hledání při psaní */
.search { margin-bottom: 12px; }

.matches { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.match {
    width: 100%;
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 2px solid var(--asphalt);
    border-radius: 12px;
    background: var(--white);
    color: var(--asphalt);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.match:active { background: var(--hivis); }
.match:focus-visible { outline: 4px solid var(--eu-blue); outline-offset: 2px; }
.match-plate {
    flex: none;
    padding: 2px 10px 2px 8px;
    border: 2px solid var(--asphalt);
    border-left: 8px solid var(--eu-blue);
    border-radius: 6px;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}
.match-details { color: var(--muted); font-size: 0.95rem; }

.link-btn {
    margin-left: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--eu-blue);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

/* Výsledek hledání */
.result { background: var(--white); border-radius: 14px; padding: 16px; display: grid; gap: 8px; }
.result-plate { margin: 0; font-size: 1.1rem; font-weight: 700; letter-spacing: 0.06em; }
.result-model { margin-left: 8px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.result-status {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
    padding-left: 12px;
    border-left: 12px solid var(--hivis);
}

/* Mapa */
.map { position: relative; border-radius: 12px; overflow: hidden; background: #CFD4D8; }
.map svg { display: block; width: 100%; height: auto; }
.map-toggle {
    position: absolute;
    right: 8px;
    bottom: 8px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    border: 2px solid var(--asphalt);
    background: var(--white);
    color: var(--asphalt);
    font: inherit;
    font-weight: 700;
    font-size: 0.95rem;
}

/* Blikající autíčko */
.car-outline { fill: var(--white); }
.car-wheel { fill: var(--asphalt); }
.car-body { fill: var(--signal); }
.car-glass { fill: #1B2530; }
.car-roof { fill: #B81D25; }
.car-light { fill: var(--hivis); }
.map-car { animation: car-blink 0.9s ease-in-out infinite; }
.map-car-halo {
    fill: var(--hivis);
    fill-opacity: 0.35;
    stroke: var(--hivis);
    stroke-width: 4;
    animation: halo 1.6s ease-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}
@keyframes car-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
@keyframes halo { from { transform: scale(0.3); opacity: 1; } to { transform: scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .map-car, .map-car-halo { animation: none; }
}

.map-attribution {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--asphalt);
    font-size: 0.7rem;
}

/* Chybová lišta Blazoru */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--hivis);
    color: var(--asphalt);
    font-weight: 600;
    z-index: 1000;
}
#blazor-error-ui .reload { margin-left: 8px; color: var(--asphalt); }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }
