/* Herstel Friesland Helpdesk — privé-pagina voor klanten */
:root {
    --ink: #1b1e23; --ink-2: #4d535d; --ink-3: #7c828c;
    --paper: #f4f4f2; --surface: #fff; --surface-2: #f8f8f6;
    --line: #e2e2dd; --line-2: #eeeee9;
    --orange: #ee6a1f; --orange-deep: #c9540f; --orange-soft: #fdeee4;
    --steel: #2f5f93; --green: #1f8a4c; --green-soft: #e3f2e9; --red: #c42f2f; --amber: #b57d06; --amber-soft: #fbf1d9; --teal: #0f7f8c;
    --r: 10px; --r-sm: 6px;
    --focus: 0 0 0 3px rgba(238, 106, 31, .35);
    --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--paper); font-size: 16px; line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--steel); }
[hidden] { display: none !important; }
img { max-width: 100%; }

.h-bar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.h-bar-in { max-width: 920px; margin: 0 auto; padding: 0 16px; min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.h-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.h-brand img { height: 20px; }
.h-brand span { color: var(--orange); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; border-left: 1px solid var(--line); padding-left: 10px; }
.h-nav { display: flex; align-items: center; gap: 4px; }
.h-nav a { color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: var(--r-sm); font-weight: 500; font-size: 15px; }
.h-nav a:hover { background: var(--surface-2); color: var(--ink); }
.h-nav a.active { color: var(--ink); box-shadow: inset 0 -2px 0 var(--orange); border-radius: 0; }
.h-linkbtn { background: none; border: 1px solid var(--line); color: var(--ink-2); border-radius: var(--r-sm); padding: 6px 10px; font: inherit; font-size: 14px; cursor: pointer; margin-left: 6px; }
.h-linkbtn:hover { border-color: var(--ink-3); color: var(--ink); }

.h-main { flex: 1; width: 100%; max-width: 920px; margin: 0 auto; padding: 28px 16px 56px; }
.h-foot { max-width: 920px; width: 100%; margin: 0 auto; padding: 16px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--ink-3); font-size: 13px; border-top: 1px solid var(--line); }

h1 { font-size: 28px; font-weight: 700; font-stretch: 92%; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 18px; font-weight: 650; margin: 0 0 12px; }
.h-sub { color: var(--ink-2); margin: 0 0 24px; }
.h-muted { color: var(--ink-3); }
.h-small { font-size: 14px; }
.h-mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.h-section { margin-top: 32px; }
.h-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.h-section-head h2 { margin: 0; }

.h-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.h-panel + .h-panel { margin-top: 16px; }

/* Actie nodig */
.h-actie { border-left: 4px solid var(--orange); background: var(--orange-soft); border-radius: var(--r); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.h-actie b { display: block; }

/* Kaarten */
.h-cards { display: grid; gap: 10px; }
.h-card { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; text-decoration: none; color: inherit; }
.h-card:hover { border-color: var(--ink-3); }
.h-card .t { font-weight: 600; }
.h-card .m { color: var(--ink-3); font-size: 14px; }
.h-card .r { grid-row: 1 / span 2; grid-column: 2; text-align: right; }

.h-badge { display: inline-block; align-self: flex-start; line-height: 1.4; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.h-badge.info { background: #e2f1f3; color: var(--teal); }
.h-badge.primary { background: var(--orange-soft); color: var(--orange-deep); }
.h-badge.warning { background: var(--amber-soft); color: var(--amber); }
.h-badge.success { background: var(--green-soft); color: var(--green); }
.h-badge.danger { background: #fbe6e6; color: var(--red); }
.h-badge.dark, .h-badge.secondary { background: #e7e7e3; color: var(--ink-2); }

/* Formulieren */
label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; color: var(--ink-2); }
.h-field { margin-bottom: 16px; }
.h-hint { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 12px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--orange); }
.h-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.h-grid .h-span { grid-column: 1 / -1; }
.h-code-input { font-size: 26px; letter-spacing: .4em; text-align: center; font-family: ui-monospace, Menlo, monospace; }

.h-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; border-radius: var(--r-sm); border: 1px solid transparent; padding: 11px 18px; cursor: pointer; text-decoration: none; background: var(--orange); color: #fff; }
.h-btn:hover { background: var(--orange-deep); }
.h-btn:disabled { opacity: .6; cursor: default; }
.h-btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.h-btn-ghost:hover { background: var(--surface-2); border-color: var(--ink-3); }
.h-btn-groen { background: var(--green); }
.h-btn-groen:hover { background: #17703d; }
.h-btn-block { width: 100%; }
.h-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.h-alert { border-radius: var(--r-sm); padding: 11px 13px; margin-bottom: 14px; font-size: 15px; border: 1px solid; }
.h-alert-err { background: #fbeaea; border-color: #efc4c4; color: var(--red); }
.h-alert-ok { background: #e8f4ec; border-color: #bfdcc9; color: var(--green); }

.h-auth { max-width: 420px; margin: 5vh auto 0; }
.h-auth .h-links { margin-top: 16px; font-size: 14px; }

/* Ticketdetail */
.h-detail { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
.h-dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; margin: 0; }
.h-dl dt { color: var(--ink-3); font-size: 14px; }
.h-dl dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.h-steps { list-style: none; margin: 0; padding: 0; }
.h-steps li { position: relative; padding: 0 0 14px 24px; }
.h-steps li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 2px var(--ink-3); }
.h-steps li::after { content: ""; position: absolute; left: 8px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.h-steps li:last-child { padding-bottom: 0; }
.h-steps li:last-child::after { display: none; }
.h-steps li:last-child::before { background: var(--orange); box-shadow: 0 0 0 2px var(--orange); }
.h-steps .d { font-size: 13px; color: var(--ink-3); }
.h-back { display: inline-block; margin-bottom: 14px; font-size: 15px; text-decoration: none; }

/* Berichten */
.h-chat { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.h-msg { max-width: 85%; padding: 10px 13px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); white-space: pre-wrap; word-break: break-word; }
.h-msg.klant { align-self: flex-end; background: var(--orange-soft); border-color: #f6d4bd; }
.h-msg .d { display: block; font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* Foto's */
.h-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 12px; }
.h-fotos a { display: block; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--line-2); }
.h-fotos img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Patroonslot */
.h-toegang-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; margin-bottom: 14px; }
.h-toegang-tabs button { font: inherit; font-size: 14px; font-weight: 500; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 8px 6px; cursor: pointer; color: var(--ink-2); text-align: center; }
.h-toegang-tabs button:hover { border-color: var(--ink-3); color: var(--ink); }
.h-toegang-tabs button.active { background: var(--orange-soft); color: var(--orange-deep); border-color: var(--orange); font-weight: 600; }
.h-patroon { position: relative; width: 240px; height: 240px; margin: 4px auto 10px; touch-action: none; user-select: none; background: var(--surface-2); border-radius: 14px; border: 1px solid var(--line); }
.h-patroon svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.h-patroon .dot { position: absolute; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.h-patroon .dot::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-3); transition: transform .1s; }
.h-patroon .dot.on::before { background: var(--orange); transform: scale(1.3); }
.h-patroon .dot .n { position: absolute; top: 2px; right: 6px; font-size: 12px; font-weight: 700; color: var(--orange-deep); }

.h-loading { color: var(--ink-3); padding: 40px 0; text-align: center; }
.h-empty { text-align: center; padding: 28px 12px; color: var(--ink-3); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); }

/* Toegangscode bekend */
.h-bekend { display: flex; gap: 10px; align-items: flex-start; background: var(--green-soft); border: 1px solid #bfdcc9; border-radius: var(--r-sm); padding: 11px 12px; margin-bottom: 12px; }
.h-bekend > span { color: var(--green); font-weight: 700; font-size: 18px; line-height: 1.2; }
.h-bekend b { color: var(--green); }
.h-btns .h-btn-block { flex: 1; }
.h-btn-rood { color: var(--red); }
.h-btn-rood:hover { border-color: var(--red); background: #fdf1f1; }

/* Opgemaakte tekst (offerte) */
.h-rich p { margin: 0 0 8px; }
.h-rich p:last-child { margin-bottom: 0; }

/* FAQ */
.h-faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0 16px; margin-bottom: 8px; }
.h-faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; }
.h-faq summary::-webkit-details-marker { display: none; }
.h-faq summary::after { content: "+"; float: right; color: var(--ink-3); font-weight: 400; }
.h-faq details[open] summary::after { content: "–"; }
.h-faq .inhoud { padding: 0 0 14px; color: var(--ink-2); }
.h-faq .inhoud img { height: auto; }

.h-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.h-table th { text-align: left; font-size: 13px; color: var(--ink-3); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.h-table td { padding: 9px 6px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.h-table .n { text-align: right; white-space: nowrap; }
.h-table tfoot td { border: 0; font-weight: 600; }

@media (max-width: 720px) {
    .h-detail, .h-grid { grid-template-columns: 1fr; }
    .h-dl { grid-template-columns: 1fr; gap: 2px; }
    .h-dl dd { margin-bottom: 8px; }
    h1 { font-size: 24px; }
    .h-nav a { padding: 8px 6px; font-size: 14px; }
    .h-brand img { height: 14px; }
    .h-brand span { font-size: 11px; padding-left: 8px; }
    .h-bar-in { padding-top: 8px; padding-bottom: 4px; }
}

textarea[aria-invalid="true"] { border-color: #c0392b; box-shadow: 0 0 0 3px rgba(192, 57, 43, .12); }

/* "Inloggen als" vanuit het portaal: balk bovenaan, alleen bekijken */
.h-beheer-balk { position: sticky; top: 0; z-index: 50; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 9px 20px; background: #1E2432; color: #fff; font-size: .9rem; }
.h-beheer-balk .h-linkbtn { color: #fff; border-color: rgba(255,255,255,.4); }
