/**
 * UNIDET v2 — Auth Layout & Density
 * Fichier : /unidet-v2/auth/assets/auth-layout.css
 *
 * Contient :
 *   - Réduction de densité de la colonne de droite (formulaires)
 *   - Fixes pour les blocs du popup (sans bordure gauche)
 *   - Alignement côte à côte pour le message email
 */

/* ═══════════════════════════════════════════════════════════
   📐 DENSITÉ ULTRA-COMPACTE — Inscription uniquement
   Scopé via body.unidet-auth-register
   ═══════════════════════════════════════════════════════════ */

body.unidet-auth-register .unidet-reg-right-inner {
    max-width: 440px !important;
    padding: 14px 20px 16px !important;
}

body.unidet-auth-register .unidet-reg-heading {
    margin-bottom: 10px !important;
}

body.unidet-auth-register .unidet-reg-h2 {
    font-size: 19px !important;
    margin: 0 0 2px !important;
    line-height: 1.15 !important;
    letter-spacing: -0.3px !important;
}

body.unidet-auth-register .unidet-reg-h2-sub {
    font-size: 11px !important;
    line-height: 1.3 !important;
    color: #64748b !important;
    margin: 0 !important;
}

body.unidet-auth-register .unidet-reg-form {
    margin-top: 0 !important;
}

body.unidet-auth-register .unidet-reg-grid {
    gap: 6px !important;
    margin-bottom: 6px !important;
}

body.unidet-auth-register .unidet-reg-field {
    gap: 2px !important;
}

body.unidet-auth-register .unidet-reg-field label {
    font-size: 11px !important;
    margin-bottom: 0 !important;
    font-weight: 700 !important;
    color: #374151 !important;
    line-height: 1.2 !important;
}

body.unidet-auth-register .unidet-reg-field input,
body.unidet-auth-register .unidet-reg-field select,
body.unidet-auth-register .unidet-reg-field textarea {
    padding: 6px 10px !important;
    font-size: 12.5px !important;
    border-radius: 7px !important;
    min-height: 33px !important;
    height: 33px !important;
    line-height: 1.3 !important;
}

body.unidet-auth-register .unidet-reg-field input::placeholder {
    font-size: 12px !important;
}

body.unidet-auth-register .unidet-reg-field .unidet-field-hint {
    font-size: 10px !important;
    margin-top: 0 !important;
    color: #94a3b8 !important;
    line-height: 1.2 !important;
}

body.unidet-auth-register .unidet-reg-topbar {
    margin-bottom: 8px !important;
    font-size: 11.5px !important;
}

body.unidet-auth-register .unidet-reg-cgu-flat {
    margin: 8px 0 !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
    gap: 6px !important;
}

body.unidet-auth-register .unidet-reg-cgu-flat input[type="checkbox"] {
    width: 14px !important;
    height: 14px !important;
    margin-top: 1px !important;
}

body.unidet-auth-register .unidet-reg-submit {
    margin-top: 2px !important;
    padding: 8px 16px !important;
    font-size: 13px !important;
    min-height: 38px !important;
    height: 38px !important;
    border-radius: 9px !important;
}

body.unidet-auth-register .unidet-reg-secure {
    margin-top: 8px !important;
    font-size: 10.5px !important;
    color: #94a3b8 !important;
}

body.unidet-auth-register .unidet-reg-message {
    padding: 7px 11px !important;
    margin-bottom: 8px !important;
    font-size: 11.5px !important;
    line-height: 1.35 !important;
    border-radius: 8px !important;
}

body.unidet-auth-register .unidet-reg-message-icon {
    font-size: 14px !important;
}

/* Password wrapper : ajustement */
body.unidet-auth-register .unidet-pwd-wrapper input {
    padding-right: 36px !important;
}

body.unidet-auth-register .unidet-pwd-wrapper .unidet-toggle-pwd {
    font-size: 13px !important;
    right: 8px !important;
}

/* Message email : plus compact */
body.unidet-auth-register .unidet-error-msg[data-for="user_email"] {
    margin-top: 3px !important;
    font-size: 11px !important;
    gap: 6px !important;
}

/* Téléphone : réduire aussi */
body.unidet-auth-register .unidet-phone-wrapper .iti,
body.unidet-auth-register .unidet-phone-wrapper .iti__flag-container {
    min-height: 33px !important;
    height: 33px !important;
}

body.unidet-auth-register .unidet-phone-wrapper input[type="tel"] {
    height: 33px !important;
    font-size: 12.5px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Hint téléphone compact */
body.unidet-auth-register .unidet-phone-msg {
    font-size: 10px !important;
    margin-top: 1px !important;
    line-height: 1.2 !important;
}

/* Media queries */
@media (max-width: 767px) {
    body.unidet-auth-register .unidet-reg-right-inner {
        max-width: 100% !important;
        padding: 14px 16px 18px !important;
    }
    body.unidet-auth-register .unidet-reg-h2 {
        font-size: 18px !important;
    }
    body.unidet-auth-register .unidet-reg-grid {
        gap: 7px !important;
    }
    body.unidet-auth-register .unidet-reg-field input,
    body.unidet-auth-register .unidet-reg-field select {
        min-height: 36px !important;
        height: 36px !important;
        font-size: 13px !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   🎯 FIX — Blocs popup SANS bordure gauche
   ═══════════════════════════════════════════════════════════ */

.upp-block.upp-block-next,
.upp-block.upp-block-tip {
    border-left: none !important;
    border: none !important;
}

/* Optionnel : adoucir légèrement le fond */
.upp-block.upp-block-next {
    background: #fef9e7 !important;
}

.upp-block.upp-block-tip {
    background: #eff6ff !important;
}

/* ═══════════════════════════════════════════════════════════
   🎯 FIX — Hint du compte à rebours TOUJOURS visible
   ═══════════════════════════════════════════════════════════ */

.upp-resend-hint {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ═══════════════════════════════════════════════════════════
   📧 Email — Message côte à côte (icône + texte + action)
   ═══════════════════════════════════════════════════════════ */

.unidet-error-msg[data-for="user_email"] {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 5px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    font-weight: 700 !important;
}

/* Icône */
.unidet-error-msg[data-for="user_email"] .email-msg-icon {
    font-weight: 800 !important;
    font-size: 13px !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
}

/* Texte principal — gras */
.unidet-error-msg[data-for="user_email"] .email-msg-text {
    font-weight: 700 !important;
    letter-spacing: -0.1px !important;
}

/* Séparateur invisible (juste pour espacer) */
.unidet-error-msg[data-for="user_email"] .email-msg-sep {
    display: inline-block !important;
    width: 6px !important;
}

/* Lien "Se connecter" — souligné, même couleur */
.unidet-error-msg[data-for="user_email"] .email-msg-action {
    color: inherit !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: opacity 0.15s !important;
    margin-left: 4px !important;
}

.unidet-error-msg[data-for="user_email"] .email-msg-action:hover {
    opacity: 0.7 !important;
}

/* État loading (gris) */
.unidet-error-msg[data-for="user_email"].is-loading {
    color: #94a3b8 !important;
}

/* État succès (vert) — priorité max */
.unidet-error-msg[data-for="user_email"].is-success,
.unidet-error-msg[data-for="user_email"].is-success * {
    color: #16a34a !important;
}

/* État erreur (rouge) — priorité max */
.unidet-error-msg[data-for="user_email"].is-error,
.unidet-error-msg[data-for="user_email"].is-error * {
    color: #e74c3c !important;
}

/* Spinner inline du loading email */
.email-msg-spinner {
    display: inline-block !important;
    width: 11px !important;
    height: 11px !important;
    border: 1.5px solid rgba(148, 163, 184, 0.35) !important;
    border-top-color: #64748b !important;
    border-radius: 50% !important;
    animation: unidetEmailSpin 0.7s linear infinite !important;
    flex-shrink: 0 !important;
}

@keyframes unidetEmailSpin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════
   📧 Messages email — Versions génériques (forgot + register)
   ═══════════════════════════════════════════════════════════ */

.unidet-error-msg[data-for="forgot_email"],
.unidet-error-msg[data-for="user_email"] {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 5px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    font-weight: 700 !important;
}

.unidet-error-msg[data-for="forgot_email"] .email-msg-icon,
.unidet-error-msg[data-for="user_email"] .email-msg-icon {
    font-weight: 800 !important;
    font-size: 13px !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
}

.unidet-error-msg[data-for="forgot_email"] .email-msg-text,
.unidet-error-msg[data-for="user_email"] .email-msg-text {
    font-weight: 700 !important;
    letter-spacing: -0.1px !important;
}

.unidet-error-msg[data-for="forgot_email"] .email-msg-sep,
.unidet-error-msg[data-for="user_email"] .email-msg-sep {
    display: inline-block !important;
    width: 6px !important;
}

.unidet-error-msg[data-for="forgot_email"] .email-msg-action,
.unidet-error-msg[data-for="user_email"] .email-msg-action {
    color: inherit !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: opacity 0.15s !important;
    margin-left: 4px !important;
}

.unidet-error-msg[data-for="forgot_email"] .email-msg-action:hover,
.unidet-error-msg[data-for="user_email"] .email-msg-action:hover {
    opacity: 0.7 !important;
}

/* États colorés (forcé par JS aussi, mais ceinture-bretelles) */
.unidet-error-msg[data-for="forgot_email"].is-loading,
.unidet-error-msg[data-for="user_email"].is-loading {
    color: #94a3b8 !important;
}

.unidet-error-msg[data-for="forgot_email"].is-success,
.unidet-error-msg[data-for="forgot_email"].is-success *,
.unidet-error-msg[data-for="user_email"].is-success,
.unidet-error-msg[data-for="user_email"].is-success * {
    color: #16a34a !important;
}

.unidet-error-msg[data-for="forgot_email"].is-error,
.unidet-error-msg[data-for="forgot_email"].is-error *,
.unidet-error-msg[data-for="user_email"].is-error,
.unidet-error-msg[data-for="user_email"].is-error * {
    color: #e74c3c !important;
}
/* ═══════════════════════════════════════════════════════════
   B34 — Message d'erreur des champs mot de passe

   Depuis que les critères ne sont plus affichés à l'avance, ce
   message est LA SEULE information de l'utilisateur : il doit être
   lisible. L'ancien rouge #e74c3c ne donnait que 3,65:1 sur le fond
   #FAFAF7 (WCAG AA exige 4,5:1 pour du texte de 12,5 px). #B3261E
   donne 6,25:1 — même rôle sémantique, contraste conforme.
   ═══════════════════════════════════════════════════════════ */
body.unidet-auth-body .unidet-error-msg,
body.unidet-auth-body .unidet-error-msg * {
    color: #B3261E;
}

/* ═══════════════════════════════════════════════════════════
   B34 — Anciennes coches de critères (.unidet-pwd-rules)

   Plus imprimées sur AUCUN formulaire d'authentification (inscription,
   réinitialisation, définition du mot de passe) : la demande client est
   de ne rien montrer à l'avance. Les classes restent définies car
   l'écran Sécurité du tableau de bord s'en sert encore, et le garde-fou
   register couvre un éventuel cache de markup.
   ═══════════════════════════════════════════════════════════ */
body.unidet-auth-register .unidet-pwd-rules {
    display: none !important;
}
.unidet-pwd-rules {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}
.unidet-pwd-rule {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    line-height: 1.3;
    transition: color 0.2s;
}
.unidet-pwd-rule::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.unidet-pwd-rule.is-valid {
    color: #047857;
}
.unidet-pwd-rule.is-valid::before {
    content: '✓';
    background: #10b981;
    border-color: #10b981;
    color: #fff;
    font-size: 8px;
    font-weight: 900;
}

/* ═══════════════════════════════════════════════════════════
   CORRECTIF — Le bloc d'erreur n'a PLUS de liseré latéral coloré
   ───────────────────────────────────────────────────────────
   Demande client : « je veux retirer la couleur rouge de gauche du box
   d'erreur là il a un fond rouge c'est suffisant ».

   La règle d'origine (`style.css` de production, non versionné ici) est
   `border-left: 4px solid #dc2626` sur `body.unidet-auth-body
   .unidet-reg-message.error`. On l'annule, et RIEN d'autre n'est ajouté :
   le fond rouge (#fef2f2), le texte (#991b1b), l'icône et la bordure
   claire des trois autres côtés sont conservés tels quels.

   ⚠️ RÈGLE PERMANENTE DU CLIENT : aucune couleur sur la GAUCHE, ni en
   partie ni tout autour. Ne jamais réintroduire de `border-left` colorée
   ici, ni remplacer par un `::before` qui dessinerait une barre.

   ⚠️ Fichier ajouté EN FIN de feuille, sélecteur PORTÉ (body.unidet-auth-
   body …), `!important` : la feuille de production garde sa règle, celle-ci
   l'emporte par l'ordre de chargement. Aucune règle globale ajoutée.
   ═══════════════════════════════════════════════════════════ */
body.unidet-auth-body .unidet-reg-page .unidet-reg-message.error {
    border-left: 0 !important;
}
