/* ============================================================
   ExamBox — Page de connexion centralisee (rapide, sans menu)
   Reprend la charte graphique et les classes .login-* deja
   utilisees par prof/admin (memes couleurs, memes conventions).
   ============================================================ */
:root {
    --si-primary: #1a237e;
    --si-primary-dark: #0d1642;
    --si-primary-light: #3949ab;
    --si-accent: #ff6f00;
    --si-accent-light: #ff9800;
    --si-text: #1e293b;
    --si-text-light: #64748b;
    --si-bg: #f8fafc;
    --si-card: #ffffff;
    --si-border: #e2e8f0;

    --si-gradient: linear-gradient(135deg, #1a237e 0%, #3949ab 50%, #1a237e 100%);
    --si-shadow: 0 4px 20px rgba(26,35,126,0.12);
    --si-shadow-lg: 0 10px 40px rgba(26,35,126,0.18);
}

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

html { font-size: 16px; }

body {
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--si-gradient);
    color: var(--si-text);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

a { text-decoration: none; color: inherit; }

/* ----- Carte centrale ----- */
.auth-shell {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background: var(--si-card);
    border-radius: 24px;
    box-shadow: var(--si-shadow-lg);
    padding: 40px 36px;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--si-primary);
    margin-bottom: 24px;
}

.auth-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--si-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.auth-card h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--si-primary-dark);
    text-align: center;
    margin-bottom: 6px;
}

.auth-card-sub {
    text-align: center;
    color: var(--si-text-light);
    font-size: 0.95rem;
    margin-bottom: 28px;
}

/* ----- Selecteur d'espace (tabs) ----- */
.role-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: var(--si-bg);
    border: 1px solid var(--si-border);
    border-radius: 14px;
    padding: 5px;
    margin-bottom: 24px;
}

.role-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--si-text-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.role-tab .role-tab-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.role-tab:hover {
    color: var(--si-primary);
}

.role-tab.active {
    background: var(--si-card);
    color: var(--si-primary-dark);
    box-shadow: var(--si-shadow);
}

.role-tab.active[data-role="admin"] {
    color: #374151;
}

/* ----- Formulaire ----- */
.role-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.role-form[hidden] {
    display: none;
}

.form-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--si-text);
    margin-bottom: 6px;
}

.form-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--si-border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--si-text);
    background: #fff;
    transition: border-color 0.2s ease;
}

.form-field input:focus {
    outline: none;
    border-color: var(--si-primary-light);
}

.auth-submit {
    margin-top: 4px;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: var(--si-gradient);
    color: white;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.98rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(26,35,126,0.28);
}

.role-form[data-role-form="admin"] .auth-submit {
    background: linear-gradient(135deg, #374151 0%, #6b7280 100%);
}

.role-form[data-role-form="admin"] .auth-submit:hover {
    box-shadow: 0 6px 18px rgba(55,65,81,0.32);
}

.role-form[data-role-form="etudiant"] .auth-submit {
    background: linear-gradient(135deg, #ff6f00 0%, #ff9800 100%);
}

.role-form[data-role-form="etudiant"] .auth-submit:hover {
    box-shadow: 0 6px 18px rgba(255,111,0,0.3);
}

.auth-error {
    background: rgba(220,38,38,0.08);
    border: 1px solid rgba(220,38,38,0.25);
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
}

.auth-footnote {
    margin-top: 4px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--si-text-light);
}

.auth-footnote a {
    color: var(--si-primary);
    font-weight: 600;
}

.auth-copyright {
    margin-top: 20px;
    text-align: center;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.75);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 28px 22px;
        border-radius: 18px;
    }

    .role-tab {
        font-size: 0.7rem;
        padding: 8px 2px;
    }
}
