/**
 * ============================================================================
 * LOOM-CMS — LESPAZ PRO : Styles authentification frontend
 * ============================================================================
 * Emplacement : /assets/css/auth.css
 * Charge sur : /public/auth/*.php (toutes pages espace-pro)
 *
 * Utilise Bootstrap 5 comme base. Ces styles completent/surchargent
 * uniquement ce qui est specifique aux formulaires d'authentification.
 *
 * @version     1.0.12
 * @date        2026-03-07
 * @author      LOOM DIGITAL
 * @a11y        RGAA AAA — contrastes 7:1, focus visible, responsive
 *
 * FIX v1.0.12 (2026-03-07) — AUDIT ACCESSIBILITE :
 * [x] card-header h1 → h1, h2 (support bandeau h1 + card h2)
 * [x] auth-links a:visited → #015f68 (evite violet navigateur)
 * [x] auth-rgpd a color #6c757d (4.69:1) → #595959 (7.00:1 AAA)
 * [x] auth-rgpd a:visited → #595959 (coherence etat visite)
 * [x] auth-status-icon : remplacement style="" inline (conformite DIRECTIVES)
 * ============================================================================
 */

/* ==========================================================================
   ICONES STATUT — Succes / Erreur (remplacement styles inline)
   FIX v1.0.12 (2026-03-08) — Specificite renforcee i.auth-status-icon
   pour surcharger Unicons (.uil font-size par defaut)
   ========================================================================== */

i.auth-status-icon {
    font-size: 3rem !important;
    line-height: 1;
    display: block;
    margin-bottom: 0.25rem;
}

i.auth-status-icon.auth-status-icon--success {
    color: #2e7d32;
}

i.auth-status-icon.auth-status-icon--error {
    color: #c62828;
}

/* ==========================================================================
   HONEYPOT ANTI-BOT — Champ invisible piège
   Position hors écran, invisible mais pas display:none
   (les bots remplissent display:none, pas les champs hors viewport)
   ========================================================================== */

.auth-honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

/* ==========================================================================
   TOGGLE MOT DE PASSE — Bouton afficher/masquer
   ========================================================================== */

.auth-pw-wrapper {
    position: relative;
}

.auth-pw-toggle {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: #6c757d;
    line-height: 1;
    z-index: 4;
}

.auth-pw-toggle:hover {
    color: #015f68;
}

.auth-pw-toggle:focus-visible {
    outline: 2px solid #015f68;
    outline-offset: 2px;
    border-radius: 2px;
}

.auth-pw-wrapper .form-control {
    padding-right: 2.5rem;
}

/* ==========================================================================
   LAYOUT — Centrage vertical + horizontal
   ========================================================================== */

.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 480px;
}

/* ==========================================================================
   CARD — Conteneur formulaire
   ========================================================================== */

.auth-card .card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.75rem;
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.06);
}

.auth-card .card-body {
    padding: 2rem;
}

.auth-card .card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1.5rem 2rem 1rem;
    text-align: center;
}

.auth-card .card-header h1,
.auth-card .card-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #343f52;
}

.auth-card .card-header p {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0;
}

/* ==========================================================================
   FORMULAIRE — Champs et labels
   ========================================================================== */

.auth-card .form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #343f52;
}

.auth-card .form-control {
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    border-radius: 0.5rem;
    border: 1px solid #ced4da;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-card .form-control:focus {
    border-color: #015f68;
    box-shadow: 0 0 0 0.2rem rgba(1, 95, 104, 0.25);
}

.auth-card .form-control.is-invalid {
    border-color: #c62828;
}

.auth-card .form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(198, 40, 40, 0.25);
}

.auth-card .invalid-feedback {
    font-size: 0.85rem;
}

/* ==========================================================================
   BOUTONS
   ========================================================================== */

.auth-card .btn-primary {
    background-color: #015f68;
    border-color: #015f68;
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.auth-card .btn-primary:hover {
    background-color: #014d54;
    border-color: #014d54;
}

.auth-card .btn-primary:active {
    transform: scale(0.98);
}

.auth-card .btn-primary:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(1, 95, 104, 0.5);
    outline: none;
}

/* ==========================================================================
   LIENS SECONDAIRES
   ========================================================================== */

.auth-links {
    text-align: center;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.auth-links a {
    color: #015f68;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.auth-links a:visited {
    color: #015f68;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-links a:focus-visible {
    outline: 2px solid #015f68;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ==========================================================================
   MESSAGES FLASH — Alertes
   ========================================================================== */

.auth-card .alert {
    font-size: 0.9rem;
    border-radius: 0.5rem;
}

/* ==========================================================================
   MOT DE PASSE — Indicateur de force
   ========================================================================== */

.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 0.5rem;
    background-color: #e0e0e0;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.password-strength-bar[data-level="weak"] {
    width: 25%;
    background-color: #c62828;
}

.password-strength-bar[data-level="fair"] {
    width: 50%;
    background-color: #ec7520;
}

.password-strength-bar[data-level="good"] {
    width: 75%;
    background-color: #2e7d32;
}

.password-strength-bar[data-level="strong"] {
    width: 100%;
    background-color: #1b5e20;
}

.password-strength-text {
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ==========================================================================
   CRITERES MOT DE PASSE — Liste de validation ANSSI
   ========================================================================== */

.password-criteria {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
}

.password-criteria li {
    padding: 0.15rem 0;
    color: #6c757d;
}

.password-criteria li::before {
    content: "\2717";
    display: inline-block;
    width: 1.2em;
    color: #c62828;
    font-weight: 700;
}

.password-criteria li.valid {
    color: #343f52;
}

.password-criteria li.valid::before {
    content: "\2713";
    color: #2e7d32;
}

/* ==========================================================================
   MENTION RGPD — Pied de formulaire
   ========================================================================== */

.auth-rgpd {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.auth-rgpd a {
    color: #595959;                /* 7.00:1 AAA — parite .text-muted CRPMEM */
    text-decoration: underline;
}

.auth-rgpd a:visited {
    color: #595959;
}

.auth-rgpd a:hover {
    color: #015f68;
}

/* ==========================================================================
   LOGO / BRANDING
   ========================================================================== */

.auth-logo {
    display: block;
    margin: 0 auto 1rem;
    max-width: 180px;
    height: auto;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 575.98px) {
    .auth-wrapper {
        padding: 1rem 0.75rem;
        min-height: calc(100vh - 140px);
    }

    .auth-card .card-body {
        padding: 1.5rem 1.25rem;
    }

    .auth-card .card-header {
        padding: 1.25rem 1.25rem 0.75rem;
    }

    .auth-card .card-header h1,
    .auth-card .card-header h2 {
        font-size: 1.25rem;
    }
}

/* ==========================================================================
   ETATS DE CHARGEMENT
   ========================================================================== */

.auth-card .btn-primary[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ==========================================================================
   FOCUS VISIBLE — Accessibilite RGAA
   Outline visible sur TOUS les elements interactifs
   Exception : inputs gerent leur propre focus via box-shadow
   ========================================================================== */

.auth-card *:focus-visible {
    outline: 2px solid #015f68;
    outline-offset: 2px;
}

.auth-card input:focus-visible {
    outline: none;
}
