/* ============================================
   DePraktijkDigitaal.nl - Login/Registratie v2.0
   Split-panel layout · Modern forms
   ============================================ */

@keyframes dpdFormIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes dpdShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}
@keyframes dpdCheckmark {
    from { stroke-dashoffset: 24; }
    to   { stroke-dashoffset: 0; }
}
@keyframes dpdSpinner {
    to { transform: rotate(360deg); }
}

/* ===== PAGE WRAPPER ===== */
/* Split-panel: left brand + right form.
   Houdt rekening met de vaste .dpd-header (72px) bovenaan. */
.dpd-auth {
    font-family: var(--dpd-font);
    min-height: calc(100vh - 72px);
    display: flex;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
/* Admin bar compensatie */
.admin-bar .dpd-auth {
    min-height: calc(100vh - 72px - 32px);
}
@media (max-width: 782px) {
    .admin-bar .dpd-auth {
        min-height: calc(100vh - 72px - 46px);
    }
}

/* ===== LEFT PANEL (brand) ===== */
/* Note: add div.dpd-auth__panel to the PHP snippet for the split layout.
   Falls back gracefully to centered card when panel is absent. */
.dpd-auth__panel {
    display: none; /* hidden by default, shown on desktop */
    width: 44%;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--dpd-blue-700) 0%, var(--dpd-blue-500) 55%, var(--dpd-green-500) 100%);
    padding: 48px;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.dpd-auth__panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.08) 1px, transparent 0);
    background-size: 28px 28px;
    pointer-events: none;
}
.dpd-auth__panel::after {
    content: '';
    position: absolute;
    bottom: -80px; left: -80px;
    width: 300px; height: 300px;
    background: rgba(255,255,255,.05);
    border-radius: 50%;
    pointer-events: none;
}

.dpd-auth__panel-body {
    position: relative;
    z-index: 1;
    margin-top: auto;
    margin-bottom: auto;
}
.dpd-auth__panel-eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 6px 12px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    margin-bottom: 20px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.dpd-auth__panel-body h2 {
    font-size: 32px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -.025em;
    margin: 0 0 14px;
    line-height: 1.15;
    max-width: 340px;
}
.dpd-auth__panel-body p {
    font-size: 15px;
    line-height: 1.65;
    color: rgba(255,255,255,.78);
    max-width: 320px;
    margin: 0;
}

.dpd-auth__panel-trust {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dpd-auth__panel-trust li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(255,255,255,.75);
    list-style: none;
}
.dpd-auth__panel-trust li svg {
    color: var(--dpd-green-200);
    flex-shrink: 0;
}

@media (min-width: 860px) {
    .dpd-auth__panel { display: flex; }
}

/* ===== RIGHT PANEL (form area) ===== */
.dpd-auth__right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: var(--dpd-gray-50);
}

/* ===== CARD (fallback centred layout) ===== */
.dpd-auth__card {
    background: var(--dpd-bg-card);
    border-radius: var(--dpd-radius-xl);
    border: 1px solid var(--dpd-border);
    padding: 36px 36px 28px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--dpd-shadow-sm);
    animation: dpdFormIn .5s var(--dpd-ease-spring) both;
}

/* When inside .dpd-auth__right, fill the column */
.dpd-auth__right .dpd-auth__card {
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
    animation: dpdFormIn .5s .1s var(--dpd-ease-spring) both;
}

.dpd-auth__card--shake {
    animation: dpdShake .4s var(--dpd-ease-smooth);
}

/* ===== HEADER ===== */
.dpd-auth__header {
    margin-bottom: 28px;
}

/* Mobile logo verborgen - de globale .dpd-header toont al het logo,
   dus dit voorkomt een dubbel logo op alle schermformaten. */
.dpd-auth__logo {
    display: none !important;
}

/* Panel info card (gebruikt in registreer) */
.dpd-auth__panel-card {
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--dpd-radius-lg);
    padding: 20px;
}

@media (min-width: 860px) {
    /* Logo in header is redundant when panel is shown */
    .dpd-auth__panel ~ .dpd-auth__right .dpd-auth__logo { display: none; }
}

.dpd-auth__title {
    font-size: 23px;
    font-weight: 800;
    color: var(--dpd-text);
    margin: 0 0 5px;
    letter-spacing: -.025em;
}
.dpd-auth__subtitle {
    font-size: 14px;
    color: var(--dpd-text-secondary);
    margin: 0;
}
.dpd-auth__subtitle a {
    color: var(--dpd-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--dpd-dur-fast);
}
.dpd-auth__subtitle a:hover { color: var(--dpd-primary-hover); }

/* Flow context banner: verschijnt als user via "Koop training"-CTA komt */
.dpd-auth__flow-note {
    background: var(--dpd-blue-50);
    border: 1px solid var(--dpd-blue-100);
    color: var(--dpd-blue-700);
    font-size: 13px;
    line-height: 1.55;
    padding: 11px 14px;
    border-radius: var(--dpd-radius-md);
    margin-bottom: 18px;
}
.dpd-auth__flow-note strong { color: var(--dpd-primary); font-weight: 700; }

/* ===== FORM FIELDS ===== */
.dpd-field {
    margin-bottom: 16px;
}
.dpd-field__label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
    color: var(--dpd-gray-700);
    margin-bottom: 6px;
}
.dpd-field__label a {
    font-size: 12px;
    color: var(--dpd-primary);
    text-decoration: none;
    font-weight: 500;
}
.dpd-field__label a:hover { text-decoration: underline; }

.dpd-field__wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.dpd-field__wrap .dpd-field__input { padding-right: 44px; }

.dpd-field__toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dpd-text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color var(--dpd-dur-fast);
}
.dpd-field__toggle:hover { color: var(--dpd-text-secondary); }

.dpd-field__input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    font-family: var(--dpd-font);
    font-size: 14px;
    color: var(--dpd-text);
    background: var(--dpd-bg);
    border: 1px solid var(--dpd-border);
    border-radius: var(--dpd-radius-md);
    outline: none;
    transition: border-color var(--dpd-dur-fast), box-shadow var(--dpd-dur-fast);
    box-sizing: border-box;
}
.dpd-field__input::placeholder { color: var(--dpd-text-muted); }
.dpd-field__input:hover { border-color: var(--dpd-gray-300); }
.dpd-field__input:focus {
    border-color: var(--dpd-primary);
    box-shadow: 0 0 0 3px rgba(26,115,181,.12);
}
.dpd-field__input--error { border-color: var(--dpd-danger); }
.dpd-field__input--error:focus { box-shadow: 0 0 0 3px rgba(212,61,61,.12); }

.dpd-field__error {
    font-size: 12px;
    color: var(--dpd-danger);
    margin-top: 5px;
    display: none;
}
.dpd-field--has-error .dpd-field__error { display: block; }

/* ===== SUBMIT BUTTON ===== */
.dpd-auth__submit {
    width: 100%;
    height: 48px;
    font-family: var(--dpd-font);
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--dpd-primary);
    border: none;
    border-radius: var(--dpd-radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: -.01em;
    margin-top: 20px;
    box-shadow: 0 1px 3px rgba(26,115,181,.2);
    transition: background var(--dpd-dur-fast),
                transform 150ms var(--dpd-ease-spring),
                box-shadow var(--dpd-dur-fast);
}
.dpd-auth__submit:hover {
    background: var(--dpd-primary-hover);
    box-shadow: 0 6px 20px rgba(26,115,181,.28);
}
.dpd-auth__submit:active { transform: scale(.97); }
.dpd-auth__submit:disabled { opacity: .55; cursor: not-allowed; }

.dpd-auth__submit .dpd-spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: dpdSpinner .6s linear infinite;
    display: none;
}
.dpd-auth__submit--loading .dpd-spinner { display: block; }
.dpd-auth__submit--loading .dpd-auth__submit-text { display: none; }

/* ===== SUCCESS STATE ===== */
.dpd-auth__success {
    text-align: center;
    padding: 24px 0;
    display: none;
}
.dpd-auth__success--show {
    display: block;
    animation: dpdFormIn .5s var(--dpd-ease-spring) both;
}
.dpd-auth__success svg { width: 48px; height: 48px; margin-bottom: 16px; }
.dpd-auth__success svg circle { fill: var(--dpd-success-light); stroke: var(--dpd-success); }
.dpd-auth__success svg path {
    stroke: var(--dpd-success);
    stroke-dasharray: 24;
    animation: dpdCheckmark .4s .2s var(--dpd-ease-spring) both;
}

/* ===== MESSAGES ===== */
.dpd-auth__message {
    font-size: 13.5px;
    padding: 11px 14px;
    border-radius: var(--dpd-radius-md);
    margin-bottom: 16px;
    display: none;
    line-height: 1.5;
}
.dpd-auth__message--error {
    display: block;
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}
.dpd-auth__message--success {
    display: block;
    background: var(--dpd-success-light);
    color: var(--dpd-green-700);
    border: 1px solid rgba(15,165,115,.2);
}

/* ===== FOOTER ===== */
.dpd-auth__footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--dpd-border-light);
}
.dpd-auth__footer p {
    font-size: 12px;
    color: var(--dpd-text-muted);
    margin: 0;
    line-height: 1.6;
}
.dpd-auth__footer a {
    color: var(--dpd-primary);
    text-decoration: none;
    font-weight: 500;
}
.dpd-auth__footer a:hover { color: var(--dpd-primary-hover); }

/* ===== RESPONSIVE ===== */

/* Tablet en kleiner: verberg linker brand-panel, form centreert zelf */
@media (max-width: 859px) {
    .dpd-auth__panel { display: none !important; }
    .dpd-auth__right {
        width: 100%;
        padding: 40px 24px;
    }
    .dpd-auth__card {
        max-width: 440px;
    }
}

/* Klein tablet / grote telefoon */
@media (max-width: 600px) {
    .dpd-auth__right {
        padding: 28px 20px 40px;
        background: var(--dpd-bg);
    }
    .dpd-auth__card {
        padding: 28px 22px 24px;
        max-width: 100%;
        border: none;
        box-shadow: none;
        background: transparent;
    }
    .dpd-auth__title {
        font-size: 22px;
    }
    .dpd-auth__subtitle {
        font-size: 13.5px;
    }
    .dpd-auth__header {
        margin-bottom: 22px;
    }
    .dpd-auth__logo img {
        height: 28px;
    }
    .dpd-field {
        margin-bottom: 14px;
    }
    .dpd-field__input {
        height: 48px;
        font-size: 15px; /* voorkomt iOS auto-zoom */
    }
    .dpd-auth__submit {
        height: 50px;
        font-size: 15px;
        margin-top: 18px;
    }
    .dpd-auth__flow-note {
        font-size: 12.5px;
        padding: 10px 12px;
    }
}

/* Kleine telefoon */
@media (max-width: 400px) {
    .dpd-auth__right {
        padding: 20px 16px 32px;
    }
    .dpd-auth__card {
        padding: 22px 16px 20px;
    }
    .dpd-auth__title {
        font-size: 20px;
    }
    .dpd-auth__header {
        margin-bottom: 18px;
    }
    .dpd-field__label {
        font-size: 12.5px;
    }
    .dpd-auth__footer {
        margin-top: 16px;
        padding-top: 16px;
    }
}

/* Voorkom horizontaal scrollen op heel smalle schermen */
@media (max-width: 480px) {
    .dpd-auth {
        display: block;
        min-height: auto;
    }
}

/* ===== VERIFICATIE POPUP ===== */
.dpd-verify-popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10001;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.dpd-verify-popup--show {
    display: flex;
}
.dpd-verify-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.dpd-verify-popup__card {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 44px 40px 36px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 80px rgba(15, 23, 42, 0.25);
    animation: dpdFormIn .5s var(--dpd-ease-spring) both;
}
.dpd-verify-popup__icon {
    margin-bottom: 20px;
}
.dpd-verify-popup__title {
    font-size: 22px;
    font-weight: 800;
    color: var(--dpd-text);
    margin: 0 0 12px;
    letter-spacing: -.025em;
}
.dpd-verify-popup__text {
    font-size: 15px;
    color: var(--dpd-text-secondary);
    margin: 0 0 6px;
    line-height: 1.6;
}
.dpd-verify-popup__text strong {
    color: var(--dpd-primary);
    font-weight: 600;
    word-break: break-all;
}
.dpd-verify-popup__subtext {
    font-size: 13px;
    color: var(--dpd-text-muted);
    margin: 0 0 24px;
    line-height: 1.5;
}
.dpd-verify-popup__resend {
    display: block;
    margin: 14px auto 0;
    background: none;
    border: none;
    font-family: var(--dpd-font);
    font-size: 13px;
    color: var(--dpd-text-muted);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--dpd-radius-md);
    transition: color var(--dpd-dur-fast), background var(--dpd-dur-fast);
}
.dpd-verify-popup__resend span {
    color: var(--dpd-primary);
    font-weight: 600;
    text-decoration: underline;
}
.dpd-verify-popup__resend:hover {
    background: var(--dpd-gray-50);
    color: var(--dpd-text-secondary);
}

/* ===== RESEND KNOP OP LOGIN PAGINA ===== */
.dpd-resend-wrap {
    margin-bottom: 4px;
}
.dpd-resend-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    font-family: var(--dpd-font);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--dpd-primary);
    background: var(--dpd-blue-50, rgba(26,115,181,.06));
    border: 1px solid var(--dpd-blue-100, rgba(26,115,181,.15));
    border-radius: var(--dpd-radius-md);
    cursor: pointer;
    transition: background var(--dpd-dur-fast), border-color var(--dpd-dur-fast);
}
.dpd-resend-btn:hover {
    background: rgba(26,115,181,.1);
    border-color: rgba(26,115,181,.25);
}
.dpd-resend-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}
.dpd-resend-btn svg {
    flex-shrink: 0;
}

/* ===== RESPONSIVE POPUP ===== */
@media (max-width: 480px) {
    .dpd-verify-popup__card {
        padding: 32px 24px 28px;
        border-radius: 16px;
    }
    .dpd-verify-popup__title {
        font-size: 20px;
    }
    .dpd-verify-popup__text {
        font-size: 14px;
    }
}
