/* ============================================================
   Smet Werfleiding — schil (werfleiding.smetapp.com)

   De kleurtokens zijn overgenomen uit smetapp static/css/app.css (zoals
   clientportal en de beheerconsole), zodat elke app van Smet dezelfde
   huisstijl draagt. Mobiel eerst: 16px basis (anders zoomt iOS bij elke
   focus in), tikdoelen van minstens 44px, en genoeg contrast om in de zon
   op een werf te lezen.

   De CSP laat enkel stylesheets uit /static/ toe: geen style-attributen,
   geen <style>-blokken in de templates.
   ============================================================ */
:root {
    --accent:        #FE3000;
    --accent-hover:  #DD2A00;
    --accent-light:  #FFEAE6;
    --tint:          #FFF8F6;

    --content-bg: #F9FAFB;
    --panel:      #FFFFFF;
    --ink:        #0F172A;
    --ink-700:    #334155;
    --ink-600:    #475569;
    --muted:      #64748B;
    --faint:      #94A3B8;
    --line-300:   #CBD5E1;
    --line:       #E2E8F0;
    --border:     #E5E7EB;
    --chip:       #F1F5F9;
    --surface:    #F8FAFC;

    --ok-bg:   #DCFCE7;  --ok:   #16A34A;  --ok-ink:   #166534;
    --warn-bg: #FEF3C7;  --warn: #D97706;  --warn-ink: #92400E;
    --info-bg: #DBEAFE;  --info: #2563EB;  --info-ink: #1E40AF;
    --bad-bg:  #FEE2E2;  --bad:  #DC2626;  --bad-ink:  #991B1B;

    --radius:    12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 8px rgba(15, 23, 42, .06);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, .14);
    --tap: 44px;
    --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ── basis ─────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
body {
    font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--content-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--ink); line-height: 1.25; margin: 0 0 8px; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: 0 0 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wl-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
         stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.wl-verborgen {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ── kop ───────────────────────────────────────────────────────────── */
.wl-kop {
    position: sticky; top: 0; z-index: 20;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: calc(4px + env(safe-area-inset-top, 0px)) 12px 4px;
}
.wl-kop-rij {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    max-width: 960px; margin: 0 auto; min-height: 48px;
}
.wl-kop-links { display: flex; align-items: center; gap: 4px; min-width: 0; }
.wl-merk {
    display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap);
    color: var(--ink); text-decoration: none; min-width: 0;
}
.wl-merk:hover { text-decoration: none; }
.wl-merk-logo { width: 28px; height: 28px; object-fit: contain; display: block; }
.wl-merk-naam { font-size: 16px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.wl-merk-tool {
    padding-left: 8px; border-left: 1px solid var(--border);
    font-size: 14px; font-weight: 600; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wl-terug {
    display: inline-flex; align-items: center; justify-content: center;
    width: var(--tap); height: var(--tap); margin-left: -8px;
    color: var(--accent); border-radius: var(--radius-sm);
}
.wl-terug svg.ic { width: 24px; height: 24px; }
.wl-kop-acties { display: flex; align-items: center; gap: 2px; flex: none; }
.wl-kopknop {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-width: var(--tap); height: var(--tap); padding: 0 8px;
    border: 0; border-radius: var(--radius-sm); background: transparent;
    color: var(--ink-600); cursor: pointer; font-weight: 600; font-size: 14px;
}
.wl-kopknop:hover { background: var(--chip); color: var(--ink); text-decoration: none; }
.wl-kop form { margin: 0; }

.wl-talen { display: inline-flex; padding: 3px; gap: 2px; background: var(--chip); border-radius: 999px; }
.wl-taal {
    min-width: 36px; height: 30px; padding: 0 8px; border: 0; border-radius: 999px;
    background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer;
}
.wl-taal.is-actief { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ── inhoud ────────────────────────────────────────────────────────── */
.wl-inhoud {
    flex: 1;
    width: 100%; max-width: 960px; margin: 0 auto;
    padding: 16px 16px calc(32px + var(--safe-b));
}
.wl-inhoud-smal { max-width: 460px; }
.wl-paginatitel { margin: 4px 0 4px; }
.wl-sub { color: var(--muted); margin-bottom: 16px; }
.wl-klein { font-size: 14px; color: var(--muted); }

.wl-kaart {
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 18px;
}
.wl-kaart + .wl-kaart { margin-top: 12px; }
.wl-kaart-logo { display: block; height: 44px; width: auto; margin: 0 auto 14px; }
.wl-kaart-voet { margin: 14px 0 0; text-align: center; font-size: 14px; color: var(--muted); }

/* ── meldingen ─────────────────────────────────────────────────────── */
.wl-meldingen { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.wl-melding, .wl-fout-blok {
    padding: 10px 12px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 500;
    background: var(--info-bg); color: var(--info-ink); border: 1px solid #BFDBFE;
}
.wl-melding-success { background: var(--ok-bg); color: var(--ok-ink); border-color: #BBF7D0; }
.wl-melding-warning { background: var(--warn-bg); color: var(--warn-ink); border-color: #FDE68A; }
.wl-melding-error, .wl-fout-blok { background: var(--bad-bg); color: var(--bad-ink); border-color: #FECACA; }
.wl-fout-blok { margin-bottom: 12px; }

/* ── formulieren ───────────────────────────────────────────────────── */
.wl-formulier { display: grid; gap: 14px; margin: 0; }
.wl-veld { display: grid; gap: 6px; }
.wl-veld label, .wl-label { font-size: 14px; font-weight: 650; color: var(--ink-700); }
.wl-invoer, .wl-veld input[type=text], .wl-veld input[type=email], .wl-veld input[type=password],
.wl-veld input[type=date], .wl-veld input[type=search], .wl-veld select, .wl-veld textarea {
    width: 100%; min-height: var(--tap); padding: 10px 12px;
    border: 1px solid var(--line-300); border-radius: var(--radius-sm); background: var(--panel);
    font-size: 16px;
}
.wl-veld textarea { min-height: 96px; resize: vertical; }
.wl-veld input:focus, .wl-veld select:focus, .wl-veld textarea:focus, .wl-invoer:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light);
}
.wl-hint { font-size: 13px; color: var(--muted); }
.wl-code { letter-spacing: .3em; font-size: 22px !important; text-align: center; font-variant-numeric: tabular-nums; }
.wl-vink { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink-700); cursor: pointer; }
.wl-vink input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

.wl-knop {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--tap); padding: 10px 18px;
    border: 1px solid var(--line-300); border-radius: var(--radius-sm);
    background: var(--panel); color: var(--ink); font-size: 16px; font-weight: 650;
    cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.wl-knop:hover { text-decoration: none; background: var(--surface); }
.wl-knop:disabled { opacity: .5; cursor: not-allowed; }
.wl-knop-primair { background: var(--accent); border-color: var(--accent); color: #fff; }
.wl-knop-primair:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.wl-knop-gevaar { color: var(--bad); border-color: #FECACA; }
.wl-knop-blok { width: 100%; }
.wl-knop-groot { min-height: 54px; font-size: 17px; }
.wl-knop-link {
    border: 0; background: none; padding: 6px; color: var(--accent); font-weight: 600; cursor: pointer;
}
.wl-knoppen { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── startscherm ───────────────────────────────────────────────────── */
.wl-groet { margin: 4px 0 2px; font-size: 24px; }
.wl-tegels { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 16px; }
.wl-tegel {
    position: relative;
    display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 14px;
    padding: 16px; min-height: 84px;
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none;
}
.wl-tegel:hover { text-decoration: none; border-color: var(--line-300); box-shadow: var(--shadow-md); }
.wl-tegel-icoon {
    display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px;
    background: var(--accent-light); color: var(--accent);
}
.wl-tegel-icoon svg.ic { width: 28px; height: 28px; }
.wl-tegel-naam { display: block; font-size: 17px; font-weight: 700; }
.wl-tegel-tekst { display: block; font-size: 14px; color: var(--muted); font-weight: 500; }
.wl-tegel-pijl { color: var(--faint); }
.wl-tegel-neutraal .wl-tegel-icoon { background: var(--chip); color: var(--ink-600); }
.wl-badge {
    display: inline-flex; align-items: center; min-width: 22px; height: 22px; padding: 0 7px;
    border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--chip); color: var(--ink-700);
}
.wl-badge-bad { background: var(--bad-bg); color: var(--bad-ink); }
.wl-badge-warn { background: var(--warn-bg); color: var(--warn-ink); }
.wl-badge-ok { background: var(--ok-bg); color: var(--ok-ink); }
.wl-badge-info { background: var(--info-bg); color: var(--info-ink); }

/* ── lijsten ───────────────────────────────────────────────────────── */
.wl-lijst { list-style: none; margin: 0; padding: 0; background: var(--panel);
            border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.wl-rij { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px;
          border-bottom: 1px solid var(--line); align-items: center; }
.wl-rij:last-child { border-bottom: 0; }
.wl-rij-titel { font-weight: 650; overflow-wrap: anywhere; }
.wl-rij-meta { grid-column: 1 / -1; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.wl-rij-fout { grid-column: 1 / -1; font-size: 13px; color: var(--bad-ink); }
.wl-leeg { padding: 28px 16px; text-align: center; color: var(--muted); }

/* ── voet ──────────────────────────────────────────────────────────── */
.wl-voet { padding: 12px 16px calc(16px + var(--safe-b)); text-align: center; font-size: 13px; color: var(--faint); }

@media (min-width: 640px) {
    .wl-tegels { grid-template-columns: 1fr 1fr; }
    .wl-inhoud { padding-top: 24px; }
}

/* Op een smalle telefoon past "Werfleiding" naast de naam van de tool, de taalkeuze en
   afmelden niet: dan enkel het logo en de tool. */
@media (max-width: 480px) {
    .wl-merk:has(.wl-merk-tool) .wl-merk-naam { display: none; }
    .wl-merk:has(.wl-merk-tool) .wl-merk-tool { padding-left: 0; border-left: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
}
