/* ---------- Page de connexion (/gestion/login/) ---------- */
/* #app-body fait déjà exactement 100vh - nav-height (nav.css) : le margin
   par défaut de <main> (base.css, 30px auto) décalait le formulaire vers le
   haut et forçait un scroll résiduel qui empêchait le centrage vertical. */
main:has(.login-page) {
    margin: 0;
    padding: 0;
    max-width: none;
    height: 100%;
}

.login-page {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    height: 100%;
    padding: 24px;
    padding-top: 17vh;
    box-sizing: border-box;
}

.login-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 340px;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.login-title {
    margin: 0;
    font-family: var(--font-head);
    font-size: 1.3rem;
    /* line-height normale (~1.55) : ~6 px d'interligne au-dessus du titre,
       la marge haute de la carte paraissait plus grande que les autres. */
    line-height: 1.2;
    color: var(--text);
    text-align: center;
}

.login-error {
    margin: 0;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: rgba(217, 83, 79, 0.12);
    color: var(--danger);
    font-size: 0.85rem;
    text-align: center;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.login-field input {
    box-sizing: border-box;
    width: 100%;
    padding: 9px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    min-width: 0;
}
.login-field input:focus { outline: none; border-color: var(--accent); }

.login-username-blur {
    filter: blur(4px);
    transition: filter 0.15s ease;
}
.login-username-blur:focus,
.login-username-blur.is-revealed {
    filter: none;
}

.login-password-wrap {
    position: relative;
    display: flex;
}
.login-password-wrap input {
    flex: 1;
    padding-right: 40px;
}
.login-password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 0;
    min-height: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
}
.login-password-toggle svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    display: block;
}
.login-password-toggle:hover,
.login-password-toggle[aria-pressed="true"] { color: var(--accent); }
.login-password-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}
.login-remember input { accent-color: var(--accent); width: 15px; height: 15px; }

.login-submit {
    margin-top: 0;
    /* Sans border-box, le <a class="login-submit"> (pas un <button>)
       faisait 100 % + 24 px de padding et débordait à droite. */
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}
.login-submit:hover { filter: brightness(1.08); }
/* Mails en mode test (vers la boîte du prof) : repère discret, couleur seule. */
.login-submit.is-mail-test { background: #d29922; color: #1b1f24; }

/* Pages mot de passe (changement, oubli) : même carte que la connexion. */
.login-text {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--text-muted);
    text-align: center;
}
.login-field-errors {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.8rem;
    color: var(--danger);
}
.login-field-help {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.login-link {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
}
.login-link a { color: var(--accent); }
a.login-submit { text-align: center; text-decoration: none; }
