/* 1. Bijgewerkte Overlay: Laat de browser scrollen als de modal te hoog is */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    
    /* Activeer verticaal scrollen op de achtergrond */
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch; /* Zorgt voor vloeiend swipen op iPhone/iOS */
    
    /* Ruimte rondom de modal op mobiel */
    padding: 20px 15px; 
    box-sizing: border-box;
    
    /* Uitlijning */
    justify-content: center;
    align-items: flex-start; /* Veranderd van 'center' naar 'top' zodat scrollen logisch start */
}

/* 2. Bijgewerkte Content Container: Marges toegevoegd voor mobiel */
.modal-content {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 35px 30px;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
    
    /* Automatische marge aan boven- en onderkant zorgt voor mooie centrering bij scrollen */
    margin: auto; 
}

/* Kruisje rechtsboven */
.modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: #0f172a;
}

/* Blauw omcirkelde avatar bovenaan */
.modal-avatar {
    width: 56px;
    height: 56px;
    border: 1.5px solid #007bff;
    border-radius: 50%;
    margin: 0 auto 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 123, 255, 0.05); /* Subtiele blauwe gloed achter de avatar */
}

.modal-avatar svg {
    width: 28px;
    height: 28px;
}

/* Titels strikt onder elkaar gecentreerd */
.modal-header {
    text-align: center;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-header h2 {
    color: #0f172a;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px 0;
    width: 100%;
}

.modal-header p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    padding: 0 10px;
    width: 100%;
}

/* Formulier labels en velden */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
}

/* Input wrappers voor de iconen */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 40px 12px 42px;
    background: #f8fafc; /* Subtiel grijze input achtergrond */
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    color: #0f172a;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.input-wrapper input::placeholder {
    color: #94a3b8;
}

.input-wrapper input:focus {
    outline: none;
    background: #ffffff;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.12);
}

/* Iconen binnen de inputs */
.input-icon {
    position: absolute;
    left: 14px;
    color: #64748b;
    display: flex;
    align-items: center;
}

.input-icon svg {
    width: 18px;
    height: 18px;
}

/* Wachtwoord verbergen/tonen oogje */
.password-toggle {
    position: absolute;
    right: 14px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    opacity: 0.7;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

.password-toggle:hover {
    color: #0f172a;
    opacity: 1;
}

/* Rechts uitgelijnde Wachtwoord vergeten optie */
.form-options {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 25px;
    font-size: 13px;
}

.forgot-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* De blauwe inlogknop */
.btn-login {
    width: 100%;
    padding: 13px;
    background: #007bff;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.btn-login:hover {
    background: #0056b3;
}

.btn-icon-svg {
    width: 18px;
    height: 18px;
}

/* Footer met gecentreerde hulp-vraag en werkend SVG icoon */
.modal-footer {
    margin-top: 25px;
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    color: #64748b;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.footer-icon-svg {
    width: 18px;
    height: 18px;
    color: #64748b;
    flex-shrink: 0;
}

.modal-footer a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.modal-footer a:hover {
    text-decoration: underline;
}

/* Foutmelding binnen lichte stijl */
.modal-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    text-align: center;
}

/* Succesmelding binnen lichte stijl */
.modal-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    text-align: center;
    font-weight: 500;
}

/* Wachtwoordvoorwaarden checklist */
.password-requirements {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 2px;
    font-size: 13px;
    color: #64748b;
}

.password-requirements li {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}

/* Rode weergave (Niet gehaald) */
.password-requirements li.invalid {
    color: #94a3b8;
}
.password-requirements li.invalid::before {
    content: "✕";
    color: #ef4444;
    font-weight: 700;
}

/* Groene weergave (Wel gehaald) */
.password-requirements li.valid {
    color: #166534;
    font-weight: 500;
}
.password-requirements li.valid::before {
    content: "✓";
    color: #22c55e;
    font-weight: 700;
}

/* Gedeactiveerde knop styling */
.btn-login:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}
.btn-login:disabled:hover {
    background: #cbd5e1;
    transform: none;
}
/* Tegel grid voor de modules */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 gelijke kolommen op desktop */
    gap: 12px;
    margin-bottom: 25px;
}

/* De individuele module tegel */
.dashboard-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
}

.dashboard-item:hover {
    background: rgba(0, 123, 255, 0.04);
    border-color: #007bff;
    transform: translateY(-2px);
}

.db-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.db-title {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

/* De rode Premium Uitlogknop */
.btn-logout {
    width: 100%;
    padding: 13px;
    background: #ef4444; /* Veiligheids-rood */
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: background-color 0.2s;
    box-sizing: border-box;
}

.btn-logout:hover {
    background: #dc2626;
}

/* Responsiviteit: Schaal naar 1 enkele kolom op mobiele schermen */
@media (max-width: 480px) {
    .dashboard-grid {
        grid-template-columns: 1fr; 
        gap: 10px;
    }
    .dashboard-item {
        flex-direction: row;
        justify-content: flex-start;
        padding: 14px 20px;
        gap: 15px;
    }
    .db-icon {
        margin-bottom: 0;
    }
}
