

/* ====================================================================================================================================
   ACCOUNTS (V2) - Pages d'authentification (inscription, connexion,
   mot de passe oublié/réinitialisation, vérification email).

   Charge uniquement sur les pages accounts/*.html (extra_css). Réutilise
   les tokens et composants déjà définis globalement dans base.css
   (--primary, --secondary, --border-color, --bg-card, --shadow-lg,
   .card-generator, .btn-generate, .btn-retour) - rien ici ne les
   redéfinit, on construit juste la mise en page spécifique aux cartes
   d'authentification par-dessus.
   ==================================================================================================================================== */

/* Fond papier, cohérent avec le reste du site depuis la V2 (accueil,
   Créer un document, FAQ, Contact, Mon compte) - remplace le dégradé
   ciel de base.css (--bg-body), resté sur les pages de connexion/
   inscription. Ce fichier n'est chargé que sur les pages accounts/*.html,
   donc ça ne touche aucune autre page. */
body {
    background: #faf7f2;
}

.auth-page {
    width: 100%;
    max-width: 460px;
    padding: 2.5rem 1rem 4rem;
    margin: 0 auto;
}

.auth-card {
    text-align: center;
}

/* ----- En-tête (icône ronde + titre + sous-titre) ----- */
.auth-icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary);
}

.auth-icon-circle svg {
    width: 26px;
    height: 26px;
}

.auth-card--success .auth-icon-circle {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.auth-card--error .auth-icon-circle {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 750;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.75rem;
    line-height: 1.5;
}

.auth-message {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

/* ----- Alerte (erreur générale, ex. échec de connexion) ----- */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    text-align: left;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.auth-alert-error {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-alert-error svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* ----- Formulaire ----- */
.auth-form {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-field label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.auth-field label svg {
    width: 15px;
    height: 15px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* Les champs de formulaire Django (SignupForm, AuthenticationForm,
   PasswordResetForm, SetPasswordForm) sont rendus tels quels par
   {{ field }} (voir templates) - aucune classe CSS n'est ajoutée côté
   Python (forms.py non modifié), on les cible ici par type d'input,
   scopé à .auth-form pour ne rien affecter ailleurs sur le site. */
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--gray-100);
    color: var(--text-primary);
    box-sizing: border-box;
}

.auth-form input[type="email"]:focus,
.auth-form input[type="password"]:focus,
.auth-form input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
    background: var(--bg-card);
}

/* Bouton "œil" afficher/masquer le mot de passe - ajouté en JS (base.html),
   jamais dans le rendu serveur, donc aucun impact si JS est désactivé (le
   champ reste un input password classique). */
.auth-input-wrap {
    position: relative;
}

.auth-input-wrap input[type="password"],
.auth-input-wrap input[type="text"] {
    padding-right: 2.75rem;
}

.auth-toggle-password {
    position: absolute;
    top: 50%;
    right: 0.25rem;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 0.5rem;
    transition: color 0.2s ease, background 0.2s ease;
}

.auth-toggle-password svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.auth-toggle-password:hover {
    color: var(--primary);
    background: var(--gray-100);
}

.auth-toggle-password:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.auth-field-error {
    color: #dc2626;
    font-size: 0.82rem;
    margin-top: 0.4rem;
}

.auth-field-help {
    color: var(--text-secondary);
    font-size: 0.78rem;
    margin-top: 0.4rem;
    line-height: 1.5;
}

.auth-field-help ul {
    margin: 0.3rem 0 0 1.1rem;
    padding: 0;
}

.auth-form .btn-generate {
    margin-top: 0.25rem;
}

/* Les cartes "succès"/"erreur" n'ont pas de formulaire, juste un CTA -
   .btn-generate est display:flex donc se comporte pareil en <a>. */
.auth-card--success .btn-generate,
.auth-card--error .btn-generate {
    text-decoration: none;
}

/* ----- Liens secondaires sous la carte ----- */
.auth-footer-links {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.auth-footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-footer-links a:hover {
    color: var(--primary);
}

.auth-footer-links .auth-footer-cta {
    color: var(--primary);
    font-weight: 600;
}

/* ----- Responsive ----- */
@media (max-width: 480px) {
    .auth-page {
        padding: 1.5rem 0.75rem 3rem;
    }
}
