/* ============================================
   Mijn Fiberlinq — klantenportaal
   Stijl gebaseerd op fiberlinq.nl (Barlow/Roboto,
   oranje #EC652B, donkerblauw #124272)
   ============================================ */

@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/7cHpv4kjgoGqM7EPCw.ttf') format('truetype'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/7cHqv4kjgoGqM7E30-8c4A.ttf') format('truetype'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/7cHqv4kjgoGqM7E3t-4c4A.ttf') format('truetype'); }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWubEbWmT.ttf') format('truetype'); }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWub2bWmT.ttf') format('truetype'); }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWuYjammT.ttf') format('truetype'); }

:root {
    --fl-oranje: #EC652B;
    --fl-oranje-donker: #d4551f;
    --fl-blauw: #124272;
    --fl-blauw-licht: #0274be;
    --fl-tekst: #54595F;
    --fl-grijs-bg: #f5f7fa;
    --fl-rand: #e3e8ee;
    --fl-groen: #1f9d55;
    --fl-rood: #c0392b;
}

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

body {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--fl-tekst);
    background: var(--fl-grijs-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--fl-blauw-licht); text-decoration: none; transition: color .2s; }
a:hover { color: var(--fl-blauw); }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { font-family: 'Barlow', sans-serif; color: var(--fl-blauw); line-height: 1.25; }
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 18px; font-weight: 600; }
p { margin-bottom: 1em; }

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* ── Header ── */
.portal-header { background: var(--fl-blauw); }
.portal-header .container { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }
.portal-header .logo img { height: 42px; width: auto; }
.portal-nav { display: flex; align-items: center; gap: 22px; }
.portal-nav a { color: #fff; font-family: 'Barlow', sans-serif; font-weight: 600; font-size: 15px; }
.portal-nav a:hover { color: #ffd2bd; }
.portal-nav .knop-uitloggen { background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 6px; padding: 6px 14px; font: inherit; font-family: 'Barlow', sans-serif; font-weight: 600; font-size: 15px; cursor: pointer; }
.portal-nav .knop-uitloggen:hover { background: rgba(255,255,255,.12); }
.portal-topstrip { background: var(--fl-oranje); height: 5px; }

/* ── Main / footer ── */
.portal-main { flex: 1; padding: 34px 0 60px; }
.portal-footer { background: var(--fl-blauw); color: #cfd9e6; font-size: 14px; padding: 18px 0; }
.portal-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.portal-footer a { color: #fff; }

/* ── Cards ── */
.kaart { background: #fff; border: 1px solid var(--fl-rand); border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(18,66,114,.06); }
.kaart + .kaart { margin-top: 20px; }
.kaart-kop { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.kaart-kop h2, .kaart-kop h3 { margin: 0; }

/* ── Knoppen ── */
.knop { display: inline-block; font-family: 'Barlow', sans-serif; font-weight: 600; font-size: 15px; border-radius: 8px; padding: 10px 22px; border: none; cursor: pointer; transition: background .2s; text-align: center; }
.knop-primair { background: var(--fl-oranje); color: #fff; }
.knop-primair:hover { background: var(--fl-oranje-donker); color: #fff; }
.knop-secundair { background: #fff; color: var(--fl-blauw); border: 1px solid var(--fl-blauw); }
.knop-secundair:hover { background: var(--fl-blauw); color: #fff; }
.knop-klein { padding: 6px 14px; font-size: 14px; }
.knop-gevaar { background: #fff; color: var(--fl-rood); border: 1px solid var(--fl-rood); }
.knop-gevaar:hover { background: var(--fl-rood); color: #fff; }
.knop[disabled] { opacity: .55; cursor: not-allowed; }

/* ── Formulieren ── */
.veld { margin-bottom: 16px; }
.veld label { display: block; font-family: 'Barlow', sans-serif; font-weight: 600; color: var(--fl-blauw); margin-bottom: 5px; font-size: 15px; }
.veld input[type=email], .veld input[type=password], .veld input[type=text], .veld select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--fl-rand); border-radius: 8px; font: inherit; background: #fff;
}
.veld input:focus, .veld select:focus { outline: 2px solid var(--fl-oranje); outline-offset: 0; border-color: var(--fl-oranje); }
.veld .hint { font-size: 13px; color: #8a919a; margin-top: 4px; }
.fout { color: var(--fl-rood); font-size: 14px; margin-top: 4px; }

.melding { border-radius: 8px; padding: 12px 16px; margin-bottom: 18px; font-size: 15px; }
.melding-ok { background: #e8f6ee; color: #14603a; border: 1px solid #b8e2c8; }
.melding-fout { background: #fdecea; color: #92322a; border: 1px solid #f2c4bf; }
.melding-info { background: #eaf3fb; color: #1c5687; border: 1px solid #c4dcf0; }

/* ── Login-pagina ── */
.auth-wrap { max-width: 430px; margin: 40px auto 0; }
.auth-wrap .logo-blok { text-align: center; margin-bottom: 24px; }
.auth-wrap .logo-blok img { height: 54px; width: auto; margin: 0 auto; }
.auth-links { margin-top: 16px; text-align: center; font-size: 14px; }

/* ── Verbindingen (dashboard) ── */
.verbinding-rij { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 0; border-top: 1px solid var(--fl-rand); flex-wrap: wrap; }
.verbinding-rij:first-of-type { border-top: none; }
.verbinding-info b { font-family: 'Barlow', sans-serif; color: var(--fl-blauw); font-size: 17px; }
.verbinding-info .sub { font-size: 14px; color: #8a919a; }

/* ── Badges / status ── */
.badge { display: inline-block; border-radius: 20px; font-size: 13px; font-weight: 500; padding: 3px 12px; }
.badge-aan { background: #e8f6ee; color: #14603a; }
.badge-uit { background: #f0f2f5; color: #6c757d; }
.badge-vast { background: #eaf3fb; color: #1c5687; }
.badge-planner { background: #fff3ec; color: #b04a17; }

/* ── Schakelaar (toggle) ── */
.schakelaar { position: relative; display: inline-block; width: 52px; height: 28px; flex: none; }
.schakelaar input { opacity: 0; width: 0; height: 0; }
.schakelaar .slof { position: absolute; inset: 0; background: #ccd3da; border-radius: 28px; transition: background .2s; cursor: pointer; }
.schakelaar .slof::before { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.schakelaar input:checked + .slof { background: var(--fl-groen); }
.schakelaar input:checked + .slof::before { transform: translateX(24px); }
.schakelaar input:disabled + .slof { opacity: .5; cursor: not-allowed; }

.instelling-rij { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-top: 1px solid var(--fl-rand); }
.instelling-rij:first-of-type { border-top: none; }
.instelling-rij .omschrijving b { font-family: 'Barlow', sans-serif; color: var(--fl-blauw); }
.instelling-rij .omschrijving .sub { font-size: 14px; color: #8a919a; }

/* ── Categorieën-tabel ── */
.cat-tabel { width: 100%; border-collapse: collapse; }
.cat-tabel th { font-family: 'Barlow', sans-serif; text-align: left; color: var(--fl-blauw); font-size: 14px; border-bottom: 2px solid var(--fl-rand); padding: 8px 10px; }
.cat-tabel td { border-bottom: 1px solid var(--fl-rand); padding: 10px; font-size: 15px; vertical-align: middle; }
.cat-tabel tr.vast td { color: #9aa1a9; font-style: italic; }
.cat-naam { text-transform: capitalize; }

/* ── Weekplanner ── */
.planner-scroll { overflow-x: auto; padding-bottom: 6px; }
.planner-grid { display: grid; grid-template-columns: 44px repeat(96, minmax(9px, 1fr)); min-width: 820px; user-select: none; touch-action: none; }
.planner-grid .uur-kop { grid-column: span 4; font-size: 11px; color: #8a919a; text-align: left; padding-bottom: 3px; white-space: nowrap; cursor: pointer; }
.planner-grid .uur-kop:hover { color: var(--fl-blauw); }
.planner-grid .dag-kop { font-family: 'Barlow', sans-serif; font-weight: 600; font-size: 13px; color: var(--fl-blauw); line-height: 22px; cursor: pointer; }
.planner-grid .dag-kop:hover { color: var(--fl-oranje); }
.planner-grid .slot { height: 22px; border: 1px solid #e7ebef; border-left-width: 0; background: #fff; cursor: pointer; }
.planner-grid .slot.uurgrens { border-right: 1px solid #b9c2cc; }
.planner-grid .slot.eerste { border-left-width: 1px; }
.planner-grid .slot.actief { background: var(--fl-blauw); border-color: var(--fl-blauw); }
.planner-uitleg { font-size: 14px; color: #8a919a; margin-top: 12px; }

/* ── Modal ── */
.modal-achtergrond { position: fixed; inset: 0; background: rgba(18,66,114,.45); display: none; align-items: flex-start; justify-content: center; padding: 30px 14px; overflow-y: auto; z-index: 50; }
.modal-achtergrond.open { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 24px; width: 100%; max-width: 1000px; }
.modal .modal-kop { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal .sluit { background: none; border: none; font-size: 26px; line-height: 1; cursor: pointer; color: #8a919a; }
.modal .sluit:hover { color: var(--fl-rood); }

/* ── Klein scherm ── */
@media (max-width: 640px) {
    h1 { font-size: 24px; }
    .kaart { padding: 18px; }
    .portal-header .logo img { height: 34px; }
    .verbinding-rij, .instelling-rij { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ── Topbalk: avatar + geavanceerd ── */
.avatar-blok { display: flex; align-items: center; gap: 10px; }
.avatar-cirkel { width: 36px; height: 36px; border-radius: 50%; background: var(--fl-oranje); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-family: 'Barlow', sans-serif; font-weight: 700; font-size: 15px; flex: none; }
.avatar-naam { color: #fff; font-family: 'Barlow', sans-serif; font-weight: 600; font-size: 15px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adv-form { display: flex; align-items: center; gap: 8px; margin-right: 8px; }
.adv-label { color: #cfd9e6; font-size: 13px; font-family: 'Barlow', sans-serif; cursor: pointer; }
.schakelaar-klein { width: 40px; height: 22px; }
.schakelaar-klein .slof::before { width: 16px; height: 16px; }
.schakelaar-klein input:checked + .slof::before { transform: translateX(18px); }

/* ── Meekijk-banner ── */
.impersonate-banner { background: #ffe9d6; border-bottom: 1px solid #f3c9a4; color: #7a4a12; font-size: 14px; padding: 8px 0; }

/* ── Klantkaart-tabs ── */
.tab-groepen { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 22px; }
.tab-groep .groep-titel { font-family: 'Barlow', sans-serif; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #8a919a; margin-bottom: 6px; }
.tab-groep .groep-links { display: flex; flex-wrap: wrap; gap: 6px; }
.tab-groep a { display: inline-block; padding: 7px 14px; border-radius: 8px; font-family: 'Barlow', sans-serif; font-weight: 600; font-size: 14px; color: var(--fl-blauw); background: #fff; border: 1px solid var(--fl-rand); }
.tab-groep a:hover { border-color: var(--fl-oranje); color: var(--fl-oranje-donker); }
.tab-groep a.actief { background: var(--fl-blauw); border-color: var(--fl-blauw); color: #fff; }

/* ── Tabellen ── */
.p-tabel { width: 100%; border-collapse: collapse; font-size: 14px; }
.p-tabel th { font-family: 'Barlow', sans-serif; text-align: left; color: var(--fl-blauw); font-size: 13px; border-bottom: 2px solid var(--fl-rand); padding: 8px 10px; white-space: nowrap; }
.p-tabel td { border-bottom: 1px solid var(--fl-rand); padding: 9px 10px; vertical-align: middle; }
.p-tabel tr:last-child td { border-bottom: none; }
.tabel-scroll { overflow-x: auto; }

/* ── Uitleg-blokjes ── */
.uitleg { background: #eaf3fb; border: 1px solid #c4dcf0; color: #1c5687; border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-bottom: 16px; }

/* ── Wachtwoord tonen/verbergen ── */
.pw-veld { font-family: monospace; letter-spacing: .5px; }

/* ── Detailregels (definitielijst) ── */
.dl-grid { display: grid; grid-template-columns: 180px 1fr; gap: 4px 14px; font-size: 15px; }
.dl-grid dt { color: #8a919a; }
.dl-grid dd { margin: 0; }
@media (max-width: 640px) { .dl-grid { grid-template-columns: 1fr; } .dl-grid dt { margin-top: 8px; } }

/* ── Klantkaart met zijbalk-menu ── */
.klant-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 26px; align-items: start; }
.klant-menu { background: #fff; border: 1px solid var(--fl-rand); border-radius: 12px; padding: 14px 0; position: sticky; top: 20px; box-shadow: 0 1px 3px rgba(18,66,114,.06); }
.menu-groep + .menu-groep { margin-top: 14px; border-top: 1px solid var(--fl-rand); padding-top: 12px; }
.menu-groep-titel { font-family: 'Barlow', sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #8a919a; padding: 0 18px 6px; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 18px; font-family: 'Barlow', sans-serif; font-weight: 600; font-size: 15px; color: var(--fl-blauw); border-left: 3px solid transparent; }
.menu-item:hover { background: var(--fl-grijs-bg); color: var(--fl-oranje-donker); }
.menu-item.actief { border-left-color: var(--fl-oranje); background: #fff3ec; color: var(--fl-oranje-donker); }
.menu-icoon { width: 20px; text-align: center; flex: none; font-size: 15px; }

/* Hamburger-knop (alleen zichtbaar op smalle schermen) */
.menu-toggle { display: none; width: 100%; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--fl-rand); border-radius: 12px; padding: 12px 16px; font-family: 'Barlow', sans-serif; font-weight: 700; font-size: 16px; color: var(--fl-blauw); cursor: pointer; box-shadow: 0 1px 3px rgba(18,66,114,.06); margin-bottom: 14px; }
.menu-toggle .hamburger { font-size: 20px; line-height: 1; }
.menu-toggle .huidige-pagina { margin-left: auto; font-weight: 400; font-size: 14px; color: #8a919a; }

@media (max-width: 800px) {
    .klant-layout { grid-template-columns: 1fr; }
    .menu-toggle { display: flex; }

    /* Menu dichtgeklapt; hamburger klapt hem open als volledig verticaal menu */
    .klant-menu { display: none; position: static; margin-bottom: 14px; }
    .klant-layout.menu-open .klant-menu { display: block; }
    .menu-item { padding: 11px 18px; }
}

/* ── Mailbox-/aliasformulier: adresregel ── */
.adres-regel { display: flex; gap: 8px; align-items: center; }
.adres-regel input { flex: 1 1 55%; min-width: 140px; }
.adres-regel select { flex: 1 1 45%; min-width: 130px; width: auto; }

/* ── Kaart-overlay met spinner (tijdens filter-sync) ── */
.kaart-overlay { position: absolute; inset: 0; background: rgba(255,255,255,.72); border-radius: 12px; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 10px; z-index: 5; }
.kaart-overlay.actief { display: flex; }
.spinner { width: 34px; height: 34px; border: 4px solid var(--fl-rand); border-top-color: var(--fl-oranje); border-radius: 50%; animation: fl-spin .8s linear infinite; }
@keyframes fl-spin { to { transform: rotate(360deg); } }
.kaart-overlay .overlay-tekst { font-family: 'Barlow', sans-serif; font-weight: 600; color: var(--fl-blauw); font-size: 14px; }

/* ── Responsive formulier-grids (klappen op smalle schermen naar 1 kolom) ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid-smal { display: grid; grid-template-columns: 1fr 130px; gap: 0 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

@media (max-width: 640px) {
    .form-grid, .form-grid-smal, .grid-2 { grid-template-columns: 1fr; }

    /* Topbalk compacter: naam verbergen, alles past naast elkaar */
    .avatar-naam { display: none; }
    .portal-nav { gap: 10px; }
    .adv-form { margin-right: 0; }
    .portal-header .container { padding-top: 10px; padding-bottom: 10px; }
    .portal-nav .knop-uitloggen { padding: 5px 10px; font-size: 13px; }

    /* Kaarten en knoppen ademen beter op klein scherm */
    .portal-main { padding: 20px 0 40px; }
    .kaart-kop { align-items: flex-start; }
    .knop { padding: 10px 16px; }
    .melding { font-size: 14px; }

    /* Details/formulieren nooit breder dan het scherm */
    details form { max-width: 100% !important; }
    .verbinding-rij > div:last-child { width: 100%; justify-content: space-between; }
}

/* Grote klik-doelen op touchscreens */
@media (pointer: coarse) {
    .menu-item { padding: 10px 14px; }
    .schakelaar { width: 56px; height: 30px; }
    .schakelaar .slof::before { width: 24px; height: 24px; }
    .schakelaar input:checked + .slof::before { transform: translateX(26px); }
    .schakelaar-klein { width: 44px; height: 24px; }
    .schakelaar-klein .slof::before { width: 18px; height: 18px; }
    .schakelaar-klein input:checked + .slof::before { transform: translateX(20px); }
}
