﻿/* ============================================================================
   Fietscontrole — design (richting doc/design.md)
   Modern, licht, hoog contrast, mobile-first. Design tokens als CSS custom
   properties. Herthematisering van de (lokale) Bootstrap-basis; geen externe
   scripts of fonts.
   ============================================================================ */

:root {
    /* Kleuren */
    --c-bg: #f4f6f9;
    --c-surface: #ffffff;
    --c-surface-2: #eef2f7;
    --c-border: #dde2e8;
    --c-text: #16202c;
    --c-muted: #5a6573;
    /* VIAS-huisstijl (grijsgroene variant): grijs primair, mint-groen accent. */
    --c-primary: #516f86;
    --c-primary-hover: #41596b;
    --c-accent: #51deb8;
    --c-accent-hover: #36c9a0;
    --c-ok: #157f3c;
    --c-ok-hover: #11682f;
    --c-nok: #c12b1f;
    --c-nok-hover: #9d2118;

    /* Vorm & ruimte */
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(16,32,48,.06), 0 1px 3px rgba(16,32,48,.08);
    --shadow: 0 6px 24px rgba(16,32,48,.10);

    --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Bootstrap-variabelen overschrijven waar mogelijk */
    --bs-body-bg: var(--c-bg);
    --bs-body-color: var(--c-text);
    --bs-body-font-family: var(--font);
    --bs-primary: var(--c-primary);
    --bs-border-color: var(--c-border);
    --bs-border-radius: var(--radius-sm);
    --bs-link-color: var(--c-primary);
    --bs-link-hover-color: var(--c-primary-hover);
}

body {
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--font);
}

/* Toegankelijkheid: zichtbare focus en skip-link */
a, .btn, .form-control, .form-select, .form-check-input, .nav-link, button {
    outline-color: var(--c-primary);
}
:focus-visible {
    outline: 3px solid var(--c-primary);
    outline-offset: 2px;
    border-radius: 4px;
}
.skip-link {
    position: absolute;
    left: -999px;
    top: .5rem;
    z-index: 1080;
    background: var(--c-primary);
    color: #fff;
    padding: .5rem .9rem;
    border-radius: var(--radius-sm);
}
.skip-link:focus { left: .5rem; }

/* Header / navigatie */
.navbar {
    background: var(--c-surface) !important;
    border-top: 3px solid var(--c-accent);   /* VIAS mint-accent */
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-sm);
}
.navbar .navbar-brand {
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--c-text);
    display: inline-flex;
    align-items: center;
    gap: .55rem;
}
/* VIAS-logo in de merkbalk */
.navbar .brand-logo {
    height: 1.6rem;
    width: auto;
    display: block;
}
.navbar .nav-link { color: var(--c-muted); font-weight: 500; }
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--c-text); }

/* Layout */
main { min-height: 60vh; }
h1, h2, h3 { letter-spacing: -.01em; }
.lead { color: var(--c-muted); }

/* Cards */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: var(--shadow); }
.list-group-item { border-color: var(--c-border); }

/* Knoppen — herthematiseer Bootstrap via --bs-btn-* */
.btn { --bs-btn-border-radius: var(--radius-sm); font-weight: 600; }
.btn-lg { --bs-btn-border-radius: var(--radius); padding: .8rem 1.1rem; }
.btn-primary {
    --bs-btn-bg: var(--c-primary); --bs-btn-border-color: var(--c-primary);
    --bs-btn-hover-bg: var(--c-primary-hover); --bs-btn-hover-border-color: var(--c-primary-hover);
    --bs-btn-active-bg: var(--c-primary-hover); --bs-btn-active-border-color: var(--c-primary-hover);
    --bs-btn-disabled-bg: var(--c-primary); --bs-btn-disabled-border-color: var(--c-primary);
}
.btn-outline-primary {
    --bs-btn-color: var(--c-primary); --bs-btn-border-color: var(--c-primary);
    --bs-btn-hover-bg: var(--c-primary); --bs-btn-hover-border-color: var(--c-primary);
    --bs-btn-active-bg: var(--c-primary-hover); --bs-btn-active-border-color: var(--c-primary-hover);
}
.btn-success {
    --bs-btn-bg: var(--c-ok); --bs-btn-border-color: var(--c-ok);
    --bs-btn-hover-bg: var(--c-ok-hover); --bs-btn-hover-border-color: var(--c-ok-hover);
}
.btn-danger {
    --bs-btn-bg: var(--c-nok); --bs-btn-border-color: var(--c-nok);
    --bs-btn-hover-bg: var(--c-nok-hover); --bs-btn-hover-border-color: var(--c-nok-hover);
}
.btn-link { --bs-btn-color: var(--c-primary); --bs-btn-hover-color: var(--c-primary-hover); font-weight: 600; }

/* OK/NOK keuze op het controleformulier — grote, duidelijke touch-targets */
.btn-check + .btn-outline-success { --bs-btn-color: var(--c-ok); --bs-btn-border-color: var(--c-ok); }
.btn-check:checked + .btn-outline-success {
    background: var(--c-ok); border-color: var(--c-ok); color: #fff;
}
.btn-check + .btn-outline-danger { --bs-btn-color: var(--c-nok); --bs-btn-border-color: var(--c-nok); }
.btn-check:checked + .btn-outline-danger {
    background: var(--c-nok); border-color: var(--c-nok); color: #fff;
}

/* Formulieren */
.form-control, .form-select {
    border-color: var(--c-border);
    border-radius: var(--radius-sm);
}
.form-control:focus, .form-select:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 .2rem rgba(81,111,134,.22);
}
.form-label { font-weight: 600; }

/* Tabellen */
.table { --bs-table-border-color: var(--c-border); }
.table > thead th {
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .04em;
    color: var(--c-muted);
    border-bottom: 2px solid var(--c-border);
}

/* Badges — voldoende contrast */
.badge.text-bg-success { background: var(--c-ok) !important; }
.badge.text-bg-danger { background: var(--c-nok) !important; }
.badge.text-bg-secondary { background: #5a6573 !important; }

/* Voortgangsbalk (statistieken) */
.progress { background: var(--c-surface-2); border-radius: 999px; height: 1.1rem; }
.progress-bar.bg-danger { background: var(--c-nok) !important; }

/* Footer */
.footer {
    border-top: 1px solid var(--c-border);
    background: var(--c-surface);
    color: var(--c-muted);
}

/* Backoffice-zijbalk */
.bo-sidebar-inner {
    position: sticky;
    top: 1rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: .75rem;
}
.bo-sidebar .nav-link {
    color: var(--c-text);
    border-radius: var(--radius-sm);
    padding: .5rem .75rem;
    font-weight: 500;
}
.bo-sidebar .nav-link:hover {
    background: var(--c-surface-2);
    color: var(--c-text);
}
.bo-sidebar .nav-link.active {
    background: var(--c-primary);
    color: #fff;
}
.bo-nav-heading {
    text-transform: uppercase;
    font-size: .68rem;
    letter-spacing: .06em;
    color: var(--c-muted);
    font-weight: 700;
    padding: .9rem .75rem .25rem;
}
/* Inklapbare menugroepen (accordion) */
.bo-group + .bo-group { margin-top: .15rem; }
.bo-group-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    width: 100%; background: transparent; border: 0; text-align: left;
    text-transform: uppercase; font-size: .68rem; letter-spacing: .06em;
    color: var(--c-muted); font-weight: 700; cursor: pointer;
    padding: .7rem .75rem .35rem;
}
.bo-group-toggle:hover { color: var(--c-text); }
.bo-group-toggle::after {
    content: "⌄"; font-size: .95rem; line-height: 1; margin-top: -.2em;
    transition: transform .15s ease;
}
.bo-group-toggle.collapsed::after { transform: rotate(-90deg); }
.bo-group-toggle:focus-visible { outline: 3px solid var(--c-primary); outline-offset: 2px; border-radius: var(--radius-sm); }
.bo-nav-back { color: var(--c-muted) !important; font-weight: 600; }
/* Actieve "terug/mijn partijen"-link: wit op de grijze actief-achtergrond (contrast). */
.bo-sidebar .nav-link.bo-nav-back.active { color: #fff !important; }

/* Side-by-side vertaaleditor: nl-basis + elke doeltaal als gelijke kolom naast elkaar.
   Vult de volledige breedte; wikkelt pas wanneer een kolom smaller dan ~240px zou worden. */
.taalgrid {
    display: grid;
    gap: .75rem 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    align-items: start;
}
.taalgrid > div { min-width: 0; }
/* nl-basiskolom subtiel markeren */
.taalgrid .taal-basis { border-left: 3px solid var(--c-primary); padding-left: .6rem; }

/* Statistiek-analyse: drill-down pivot */
.pivot-table { font-size: .9rem; width: auto; min-width: 60%; }
.pivot-table th, .pivot-table td { white-space: nowrap; }
.pivot-table thead th { background: var(--c-surface-2); vertical-align: middle; }
.pivot-table .pivot-corner { background: #fff; border: 0; }
.pivot-table .pivot-colgrp { font-weight: 600; }
.pivot-table .pivot-meas { font-weight: 500; color: var(--c-muted); }
.pivot-table .pivot-total { background: #eef2f7; }
.pivot-table .pivot-totrow td { background: #eef2f7; }
.pivot-table tbody td:first-child { text-align: left; }
.pv-tog { cursor: pointer; user-select: none; color: var(--c-primary); font-weight: 700; }
.pv-tog:hover { opacity: .7; }
.pv-chip { cursor: grab; }
.pv-chip:active { cursor: grabbing; }
.pv-chip.pv-dragging { opacity: .45; }

/* Visuele controle: marker op het voertuig-SVG */
.cp-marker {
    position: absolute; transform: translate(-50%, -50%);
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem; font-weight: 700; color: #fff;
    background: var(--c-primary); border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.35); line-height: 1;
}

/* Visuele controle-interface (controleur) */
.vc-stage { position: relative; width: 100%; max-width: 640px; margin: 0 auto; aspect-ratio: 1/1; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.vc-stage svg { width: 100%; height: 100%; pointer-events: none; }
.vc-point {
    position: absolute; transform: translate(-50%, -50%);
    width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; font-weight: 800; color: #fff; cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.4); -webkit-tap-highlight-color: transparent;
}
.vc-point.state-leeg { background: #9ca3af; }
.vc-point.state-ok   { background: var(--c-ok, #1a9c54); }
.vc-point.state-nok  { background: var(--c-nok, #d12f3a); }
.vc-point:focus-visible { outline: 3px solid var(--c-primary); outline-offset: 2px; }
.vc-legenda .vc-rij { display: flex; align-items: center; gap: .5rem; padding: .25rem 0; }
.vc-dot { width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto; }
.vc-dot.state-leeg { background: #9ca3af; } .vc-dot.state-ok { background: var(--c-ok, #1a9c54); } .vc-dot.state-nok { background: var(--c-nok, #d12f3a); }
.vc-page { max-width: 680px; }
.vc-voertuig { max-width: 320px; }
.vc-show-landscape { display: none; }

/* Mobiel landscape: header weg, fiets + legende naast elkaar, alles binnen de schermhoogte. */
@media (orientation: landscape) and (max-height: 600px) {
    .vc-page { max-width: 100%; }
    .vc-page.py-3 { padding-top: .35rem !important; padding-bottom: .35rem !important; }
    .vc-page h1 { font-size: 1.05rem; margin-bottom: 0; }
    .vc-hide-landscape { display: none !important; }
    .vc-show-landscape { display: inline-block !important; }
    .vc-kop { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .35rem; }
    .vc-kop .vc-voertuig { max-width: 220px; margin-bottom: 0 !important; }
    #vcVoertuig { display: flex; gap: .75rem; align-items: flex-start; }
    .vc-col-stage { flex: 0 0 auto; }
    .vc-col-stage .vc-stage { height: calc(100dvh - 120px); max-height: 82dvh; width: auto; max-width: 52vw; margin: 0; }
    .vc-col-info { flex: 1 1 0; min-width: 0; max-height: calc(100dvh - 120px); overflow-y: auto; }
    .vc-confirm { position: sticky; bottom: .25rem; margin-top: .4rem !important; padding: .5rem !important; font-size: 1rem; }
}

/* Lichte WYSIWYG-editor (e-mail/HTML-inhoud) */
.wz-wrap { border: 1px solid var(--c-border); border-radius: var(--radius-sm); overflow: hidden; }
.wz-toolbar {
    display: flex; flex-wrap: wrap; gap: .25rem; align-items: center;
    padding: .35rem; background: var(--c-surface-2); border-bottom: 1px solid var(--c-border);
}
.wz-btn {
    border: 1px solid var(--c-border); background: #fff; color: var(--c-text);
    border-radius: var(--radius-sm); min-width: 2rem; height: 2rem; padding: 0 .45rem;
    font-size: .9rem; line-height: 1; cursor: pointer;
}
.wz-btn:hover { background: var(--c-surface-2); border-color: var(--c-primary); }
.wz-tags { width: auto; margin-left: auto; height: 2rem; }
.wz-area {
    min-height: 180px; max-height: 480px; overflow: auto; background: #fff;
    border: 0; border-radius: 0; padding: .6rem .75rem;
}
.wz-area:focus { outline: 2px solid var(--c-primary); outline-offset: -2px; }
.wz-area p { margin: 0 0 .6rem; }
.wz-area h2 { font-size: 1.2rem; } .wz-area h3 { font-size: 1.05rem; }

/* Klikbare cijfer-kaarten (dashboard) */
.stat-link { display: block; text-decoration: none; color: inherit; }
/* Label op één regel houden zodat een lange tekst de kaart niet hoger maakt. */
.stat-link .stat-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-link .card { transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease; }
.stat-link:hover .card,
.stat-link:focus-visible .card {
    border-color: var(--c-primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

/* QR-code (2FA-enrollment, controleur-login) — responsief binnen kader */
.qr-code svg { display: block; width: 100%; height: auto; }

/* Startpagina-accent */
.hero h1 { font-weight: 800; }
.card-title { font-weight: 700; }

/* ── Registratie: stappenbalk ─────────────────────────────────────────────
   De stappen zijn een JS-laag; zonder JavaScript staat alles onder elkaar en
   is deze balk enkel een inhoudsopgave. */
.reg-wrap { max-width: 760px; }
.reg-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 20px;
  flex-wrap: wrap; counter-reset: stap; }
.reg-steps li { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px;
  border: 1px solid #DDE3E6; border-radius: 999px; font-size: 13px; font-weight: 700;
  color: #6B7A82; background: #fff; cursor: pointer; }
.reg-steps li .n { display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; background: #EEF2F4; color: #6B7A82;
  font-size: 12px; font-weight: 900; }
.reg-steps li.actief { border-color: #147452; color: #147452; }
.reg-steps li.actief .n { background: #147452; color: #fff; }
.reg-steps li.gedaan .n { background: #CDEBDF; color: #0E7A5E; }
/* Een stap met openstaande fouten blijft zichtbaar, ook als je verder navigeert. */
.reg-steps li.fout { border-color: #B42318; color: #B42318; }
.reg-steps li.fout .n { background: #FBE9E7; color: #B42318; }
.reg-nav { display: flex; gap: 10px; }
.reg-nav .btn { flex: 1; }
@media (max-width: 560px) {
  .reg-steps li { flex: 1 1 100%; border-radius: 10px; }
}
