/**
 * 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;
}