/*
 * Inter (variabel lettertype, gewicht 100–900), zelf gehost in assets/fonts/ in plaats van via Google Fonts.
 * Bron: @fontsource-variable/inter 5.3.0. Licentie: SIL Open Font License 1.1 (assets/fonts/LICENSE.txt).
 */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --max-orange: #FB5E00;
    --max-orange-hover: #E05400;
    --max-orange-focus: rgba(251, 94, 0, .2);
    --max-orange-soft: #FFF4EC;
    --max-ebony: #141932;
    --max-grey: #6B6B6B;
    --max-border: #D5D8E0;
    /* Standaard achtergrondkleur: bij "Kleur" zonder eigen kleur, of als er geen achtergrondafbeelding is. */
    --max-background: #141932;
    /* Afgeronde hoeken van het inlogkaartje; in te stellen bij Instellingen → MAX Custom Login. */
    --max-card-radius: 25px;
    /* Kleur van de footertekst onder het kaartje; in te stellen bij Instellingen → MAX Custom Login. */
    --max-footer-color: #ffffff;
    /*
     * Schaduw van het inlogkaartje en van de footertekst: Normaal (standaard). Geen, Licht en Sterk staan hieronder
     * bij body.max-card-shadow-* en body.max-footer-shadow-*; in te stellen bij Instellingen → MAX Custom Login.
     */
    --max-card-shadow: 0 1px 2px rgba(20, 25, 50, .08), 0 24px 60px rgba(20, 25, 50, .35);
    --max-footer-shadow: 0 1px 2px rgba(0, 0, 0, .6);

    /*
     * Kleurthema van het inlogkaartje: wit (standaard). Het donkere thema staat hieronder bij body.max-theme-dark;
     * in te stellen bij Instellingen → MAX Custom Login → Kleurthema.
     */
    --max-card-bg: #ffffff;
    --max-card-text: var(--max-ebony);
    --max-card-muted: var(--max-grey);
    --max-card-line: var(--max-border);
    --max-card-outline: transparent;
    --max-input-bg: #ffffff;
    --max-notice-bg: var(--max-orange-soft);
}

/* Donker kleurthema (MAX-donkerblauw), voor lichte of witte logo's. */
body.login.max-theme-dark {
    --max-card-bg: #141932;
    --max-card-text: #ffffff;
    --max-card-muted: #A9AEC4;
    --max-card-line: rgba(255, 255, 255, .2);
    /* Lichte rand, zodat het kaartje ook op een donkere achtergrond zichtbaar blijft. */
    --max-card-outline: rgba(255, 255, 255, .12);
    --max-input-bg: #1F2547;
    --max-notice-bg: rgba(255, 255, 255, .06);
}

/* Schaduw van het inlogkaartje. "Geen" is een onzichtbare schaduw, omdat de rand van het donkere thema moet blijven. */
body.login.max-card-shadow-none {
    --max-card-shadow: 0 0 0 transparent;
}

body.login.max-card-shadow-light {
    --max-card-shadow: 0 1px 2px rgba(20, 25, 50, .06), 0 8px 24px rgba(20, 25, 50, .18);
}

body.login.max-card-shadow-strong {
    --max-card-shadow: 0 2px 4px rgba(20, 25, 50, .12), 0 32px 80px rgba(20, 25, 50, .55);
}

/* Schaduw van de footertekst. */
body.login.max-footer-shadow-none {
    --max-footer-shadow: none;
}

body.login.max-footer-shadow-light {
    --max-footer-shadow: 0 1px 1px rgba(0, 0, 0, .35);
}

body.login.max-footer-shadow-strong {
    --max-footer-shadow: 0 1px 3px rgba(0, 0, 0, .85), 0 0 8px rgba(0, 0, 0, .5);
}

/* De achtergrondfoto wordt via wp_add_inline_style() als extra laag toegevoegd. */
body.login {
    font-family: "Inter", "Avenir Next", "Avenir", -apple-system, "Segoe UI", sans-serif;
    color: var(--max-ebony);
    background-color: var(--max-background);
    /* Linksonder vastzetten: daar staat het MAX-logo in de achtergrond; bijsnijden gebeurt rechts en boven. */
    background-position: left bottom;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
}

body.login #login {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0;
    padding: 56px 48px 48px;
    box-sizing: border-box;
    color: var(--max-card-text);
    background: var(--max-card-bg);
    border: 0;
    border-radius: var(--max-card-radius);
    box-shadow: 0 0 0 1px var(--max-card-outline), var(--max-card-shadow);
    overflow: hidden;
    animation: max-card-in .3s ease-in-out both;
}

@keyframes max-card-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

body.login #login h1 {
    margin: 0 0 40px;
    padding: 0;
}

body.login #login h1 a {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: 110px;
    margin: 0;
    padding: 0;
}

body.login #login form {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.login label {
    font-size: 14px;
    font-weight: 600;
    color: var(--max-card-text);
    margin-bottom: 6px;
}

.login form .input,
.login input[type="text"],
.login input[type="password"] {
    font-size: 16px;
    min-height: 46px;
    padding: 0 14px;
    margin: 0 0 18px;
    color: var(--max-card-text);
    border: 1px solid var(--max-card-line);
    border-radius: 6px;
    background: var(--max-input-bg);
    box-shadow: none;
    transition: border-color .2s ease-in-out, box-shadow .2s ease-in-out;
}

.login form .input:focus,
.login input[type="text"]:focus,
.login input[type="password"]:focus {
    border-color: var(--max-orange);
    box-shadow: 0 0 0 3px var(--max-orange-focus);
    outline: none;
}

.login .button.wp-hide-pw {
    top: 0;
    height: 46px;
    width: 46px;
    color: var(--max-card-text);
}

.login .button.wp-hide-pw:focus {
    border-color: var(--max-orange);
    box-shadow: 0 0 0 3px var(--max-orange-focus);
}

.login .lostpassword-inline {
    margin: -6px 0 18px;
    font-size: 14px;
}

.login .lostpassword-inline a,
.login #nav a,
.login #backtoblog a {
    color: var(--max-card-text);
    text-decoration: underline;
    text-decoration-color: var(--max-orange);
    text-underline-offset: 3px;
}

.login .lostpassword-inline a:hover,
.login .lostpassword-inline a:focus,
.login #nav a:hover,
.login #nav a:focus,
.login #backtoblog a:hover,
.login #backtoblog a:focus {
    color: var(--max-orange-hover);
}

.login .forgetmenot {
    float: none;
    margin-bottom: 20px;
}

.login .forgetmenot label {
    font-weight: 400;
}

.login input[type="checkbox"]:focus {
    border-color: var(--max-orange);
    box-shadow: 0 0 0 3px var(--max-orange-focus);
}

.login .submit { clear: both; }

.login .button-primary,
.login #wp-submit {
    float: none;
    width: 100%;
    min-height: 48px;
    font-size: 16px;
    font-weight: 600;
    background: var(--max-orange);
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    text-shadow: none;
    box-shadow: none;
    transition: background-color .2s ease-in-out;
}

.login .button-primary:hover,
.login #wp-submit:hover {
    background: var(--max-orange-hover);
}

.login .button-primary:focus,
.login #wp-submit:focus {
    box-shadow: 0 0 0 3px var(--max-card-bg), 0 0 0 5px var(--max-orange);
    outline: none;
}

.login #login_error,
.login .message,
.login .notice,
.login .success {
    margin: 0 0 20px;
    border-radius: 6px;
    border-left: 4px solid var(--max-orange);
    box-shadow: none;
    color: var(--max-card-text);
    background: var(--max-notice-bg);
    font-size: 14px;
}

.login #nav,
.login #backtoblog {
    margin: 16px 0 0;
    padding: 0;
    font-size: 14px;
    text-align: center;
}

/* Alleen op het inlogscherm zonder registratie: daar staat "Wachtwoord vergeten" al in het formulier. */
body.max-hide-nav #nav {
    display: none;
}

.login-credits {
    margin-top: 32px;
    padding: 0 8px;
    box-sizing: border-box;
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
    color: var(--max-footer-color);
    text-shadow: var(--max-footer-shadow);
}

.login-credits p {
    margin: 0;
}

/* Links in de footertekst krijgen de accentkleur (Instellingen → MAX Custom Login → Accentkleur). */
.login-credits a {
    color: var(--max-orange);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.login-credits a:hover,
.login-credits a:focus {
    color: var(--max-orange-hover);
}

/*
 * Donker kleurthema: onderdelen met eigen kleuren van WordPress of de browser.
 */
body.login.max-theme-dark input[type="checkbox"] {
    background: var(--max-input-bg);
    border-color: var(--max-card-line);
}

body.login.max-theme-dark .button.wp-hide-pw .dashicons {
    color: var(--max-card-text);
}

/* Door de browser automatisch ingevulde velden niet lichtblauw/geel laten kleuren. */
body.login.max-theme-dark input:-webkit-autofill,
body.login.max-theme-dark input:-webkit-autofill:hover,
body.login.max-theme-dark input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--max-card-text);
    caret-color: var(--max-card-text);
    transition: background-color 600000s 0s, color 600000s 0s;
}

/*
 * Foutmelding als balk bovenaan het scherm (assets/js/login.js).
 * Zonder JavaScript blijft #login_error gewoon in het kaartje staan.
 */
body.login #login_error.max-toast-source {
    display: none;
}

.max-toast {
    /* Hoe lang de melding blijft staan voordat hij vanzelf verdwijnt. */
    --max-toast-duration: 10s;
    position: fixed;
    overflow: hidden;
    top: calc(16px + env(safe-area-inset-top, 0px));
    left: 50%;
    z-index: 100000;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: calc(100% - 32px);
    max-width: 480px;
    padding: 14px 14px 14px 16px;
    box-sizing: border-box;
    transform: translateX(-50%);
    font-family: "Inter", "Avenir Next", "Avenir", -apple-system, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--max-ebony);
    background: #fff;
    border-left: 4px solid var(--max-orange);
    border-radius: 8px;
    box-shadow:
        0 1px 2px rgba(20, 25, 50, .08),
        0 12px 32px rgba(20, 25, 50, .3);
    animation: max-toast-in .3s ease-out both;
}

@keyframes max-toast-in {
    from { opacity: 0; transform: translate(-50%, -12px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

.max-toast__icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    font-size: 14px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    color: #fff;
    background: var(--max-orange);
    border-radius: 50%;
}

.max-toast__text {
    flex: 1 1 auto;
    padding-top: 1px;
}

.max-toast__text p {
    margin: 0;
}

.max-toast__text a {
    color: var(--max-ebony);
    text-decoration: underline;
    text-decoration-color: var(--max-orange);
    text-underline-offset: 3px;
}

.max-toast__close {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    margin: -3px -2px 0 0;
    padding: 0;
    font-size: 22px;
    line-height: 1;
    color: var(--max-grey);
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.max-toast__close:hover,
.max-toast__close:focus {
    color: var(--max-ebony);
    background: var(--max-orange-soft);
    outline: none;
}

.max-toast__close:focus-visible {
    box-shadow: 0 0 0 2px var(--max-orange);
}

/* Laadbalk onderaan; loopt van links naar rechts vol en als hij vol is, sluit login.js de melding. */
.max-toast__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--max-orange);
    transform-origin: left center;
    animation: max-toast-progress var(--max-toast-duration) linear forwards;
}

.max-toast:hover .max-toast__progress,
.max-toast:focus-within .max-toast__progress {
    animation-play-state: paused;
}

@keyframes max-toast-progress {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/*
 * Wordfence Login Security (getest met Wordfence 9.0.2).
 * Na het wachtwoord legt Wordfence #wfls-prompt-overlay over het formulier met het veld voor de 2FA-code.
 * Velden, knop en vinkje gebruiken al de stijl hierboven (.input, .button-primary, .submit); hier alleen de rest.
 */
body.login #wfls-prompt-overlay {
    align-items: flex-start;
    padding: 0;
    background: var(--max-card-bg);
    animation: max-card-in .3s ease-in-out both;
}

body.login #wfls-prompt-wrapper > p:first-child {
    margin-bottom: 6px;
}

body.login .wfls-2fa-code-help {
    color: var(--max-card-muted);
    vertical-align: middle;
}

body.login .wfls-2fa-code-help:hover,
body.login .wfls-2fa-code-help:focus {
    color: var(--max-orange);
}

/* Zes cijfers: groot, gecentreerd en met wat ruimte ertussen. */
body.login form #wfls-token {
    font-size: 24px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: .3em;
    text-align: center;
}

body.login form .wfls-remember-device-wrapper {
    float: none;
    margin-bottom: 20px;
}

body.login form .wfls-remember-device-wrapper label {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
}

/* "Inloggen met een passkey" (onder de inlogknop). */
body.login form .wfls-passkey-container .wfls-passkey-divider {
    margin: 20px 0;
    color: var(--max-card-muted);
    font-size: 14px;
}

body.login form .wfls-passkey-container .wfls-passkey-divider-label {
    background: var(--max-card-bg);
}

body.login form .wfls-passkey-container .wfls-passkey-divider::before,
body.login form .wfls-passkey-container .wfls-passkey-divider::after {
    border-top-color: var(--max-card-line);
}

body.login form .wfls-passkey-container .wfls-passkey-submit {
    min-height: 48px;
    font-size: 16px;
    font-weight: 600;
    color: var(--max-card-text);
    background: var(--max-input-bg);
    border: 1px solid var(--max-card-line);
    border-radius: 6px;
    box-shadow: none;
    transition: border-color .2s ease-in-out;
}

body.login form .wfls-passkey-container .wfls-passkey-submit:hover {
    color: var(--max-card-text);
    background: var(--max-input-bg);
    border-color: var(--max-orange);
}

body.login form .wfls-passkey-container .wfls-passkey-submit:focus {
    border-color: var(--max-orange);
    box-shadow: 0 0 0 3px var(--max-orange-focus);
    outline: none;
}

body.login form .wfls-passkey-container .wfls-passkey-icon,
body.login form .wfls-passkey-container .wfls-passkey-submit:hover .wfls-passkey-icon,
body.login form .wfls-passkey-container .wfls-passkey-submit:focus .wfls-passkey-icon {
    background-color: var(--max-orange);
}

/* Uitleg bij het vraagteken. */
.Zebra_Tooltip .Zebra_Tooltip_Message {
    font-family: "Inter", "Avenir Next", "Avenir", -apple-system, "Segoe UI", sans-serif;
    font-size: 13px;
    background: var(--max-ebony);
    border-radius: 6px;
}

.Zebra_Tooltip .Zebra_Tooltip_Arrow.Zebra_Tooltip_Arrow_Bottom div {
    border-top-color: var(--max-ebony);
}

.Zebra_Tooltip .Zebra_Tooltip_Arrow.Zebra_Tooltip_Arrow_Top div {
    border-bottom-color: var(--max-ebony);
}

@media (max-width: 782px) {
    body.login { background-attachment: scroll; }
    body.login #login { padding: 40px 28px 32px; }
    body.login #login h1 { margin-bottom: 32px; }
    body.login #login h1 a { height: 88px; }
    .login-credits { font-size: 12px; margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    body.login #login,
    body.login #wfls-prompt-overlay,
    .max-toast { animation: none; }
}
