/* ============================================
   Login / auth page — carte centrée, registre
   institutionnel (portail interne). Charte dark slate.
   ============================================ */

.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2.5rem 1.25rem;
    background: var(--bg-body);
}

/* ----- Libellé de marque (au-dessus de la carte) ----- */
.auth-wordmark {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    text-align: center;
}
.auth-wordmark-logo { display: inline-flex; }
.auth-wordmark-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}
.auth-wordmark-sub {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ----- Mention de pied ----- */
.auth-notice {
    margin: 0;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    text-align: center;
}

/* ----- Carte formulaire ----- */
.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    box-shadow: var(--shadow);
}
.auth-card h1 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    text-align: left;
    color: var(--text-primary);
}
.auth-hint {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0 0 1.5rem;
}

/* ----- Champs ----- */
.auth-form .form-group { margin-bottom: 1.25rem; }
.auth-form .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.input-wrap { position: relative; }
.input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}
.auth-form .input-wrap input {
    width: 100%;
    padding: 0.6rem 0.75rem 0.6rem 2.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-form .input-wrap input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.25);
}
.input-wrap--password input { padding-right: 2.75rem; }

/* Bouton afficher / masquer le mot de passe */
.password-toggle {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius);
    transition: color 0.15s, background 0.15s;
}
.password-toggle:hover { color: var(--text-primary); }
.password-toggle:focus-visible {
    outline: none;
    color: var(--primary);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.25);
}
.password-toggle .icon-eye-off { display: none; }
.password-toggle[aria-pressed="true"] .icon-eye { display: none; }
.password-toggle[aria-pressed="true"] .icon-eye-off { display: inline-flex; }

/* ----- Bouton principal ----- */
.auth-form .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    margin-top: 0.5rem;
}

/* ----- Lien retour ----- */
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.5rem;
    width: 100%;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}
.auth-back:hover { color: var(--primary); }

/* ----- Messages & erreurs (migrés) ----- */
.form-errors {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 1rem;
    color: var(--danger);
    font-size: 0.85rem;
}
.form-errors ul { list-style: none; margin: 0; padding: 0; }
.field-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}
.field-error ul { list-style: none; margin: 0; padding: 0; }
.messages { margin-bottom: 1rem; }
.messages .message {
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}
.messages .message.info {
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary-light);
}
.messages .message.success {
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary-light);
}

/* ----- Responsive : resserrement sous 768px ----- */
@media (max-width: 768px) {
    .auth-shell { padding: 2rem 1rem; }
    .auth-card { padding: 1.75rem; }
}
