/* ============================================ */
/* MODALES D'AUTHENTIFICATION - HYGIATEX        */
/* À placer dans assets/css/modales_style.css   */
/* ============================================ */

/* --- Overlay modal --- */
.modal-auth {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    animation: fadeInModal 0.2s ease;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Contenu modal --- */
.modal-auth-content {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    color: #333;
    animation: slideUpModal 0.3s ease;
}

@keyframes slideUpModal {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- Modal inscription plus large --- */
.modal-inscription-wide {
    max-width: 650px !important;
    max-height: 90vh;
    overflow-y: auto;
}

/* --- Bouton fermer (accessibilité) --- */
.modal-auth-close {
    position: absolute;
    top: 12px;
    right: 15px;
    font-size: 1.8rem;
    cursor: pointer;
    color: #94a3b8;
    line-height: 1;
    transition: color 0.2s;
    padding: 8px 12px;   /* zone de clic élargie */
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-auth-close:hover {
    color: #333;
}

/* --- Titre modal --- */
.modal-auth h3 {
    margin: 0 0 15px 0;
    color: #0d47a1;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
    font-size: 1.2rem;
}

/* --- Alertes (remplacement des styles inline) --- */
.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}
.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

/* --- Formulaire --- */
.modal-auth-form {
    margin-top: 15px;
}

.modal-auth-form > div {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.modal-auth-form label {
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 4px;
    color: #4a5568;
}

.modal-auth-form input[type="text"],
.modal-auth-form input[type="email"],
.modal-auth-form input[type="password"],
.modal-auth-form input[type="tel"] {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}
.modal-auth-form input:focus {
    border-color: #0091ea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 145, 234, 0.1);
}

/* --- Bouton action (accessibilité) --- */
.btn-modal-action {
    width: 100%;
    background-color: #0091ea;
    color: white;
    border: none;
    padding: 12px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 1rem;
    transition: background-color 0.2s;
}
.btn-modal-action:hover {
    background-color: #0077b6;
}
.btn-modal-action:focus-visible {
    outline: 2px solid #0056b3;
    outline-offset: 2px;
}
.btn-gradient {
    background: linear-gradient(135deg, #0091ea 0%, #0077b6 100%);
}

/* --- Liens modal --- */
.modal-links {
    margin-top: 15px;
    font-size: 0.85rem;
    text-align: center;
    color: #666;
}
.modal-links a {
    color: #0091ea;
    text-decoration: none;
    margin: 0 5px;
}
.modal-links a:hover {
    text-decoration: underline;
}

/* --- Sélecteur type de compte --- */
.type-compte-selector {
    margin-bottom: 20px;
    text-align: center;
    background: #f0f4f8;
    padding: 15px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    gap: 20px;
}
.type-compte-selector label {
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}
.type-compte-selector input[type="radio"] {
    margin-right: 5px;
}

/* --- Groupe civilité --- */
.civilite-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}
.civilite-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-weight: normal;
}

/* --- Ligne de formulaire (2 colonnes) --- */
.form-row {
    display: flex;
    gap: 10px;
}
.form-row > div {
    flex: 1;
}

/* --- Requis --- */
.required {
    color: red;
}

/* --- Champs professionnels --- */
#champs_pro_specifiques {
    display: none;
    background: #f0f4f8;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #0091ea;
}
#champs_pro_specifiques h4 {
    margin-top: 0;
    color: #0d47a1;
}

/* --- Toggle mot de passe --- */
.password-input-wrapper {
    position: relative;
}
.password-input-wrapper input {
    width: 100%;
    padding-right: 80px !important;
}
.toggle-password-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #0091ea;
    font-size: 0.85em;
    white-space: nowrap;
}
.toggle-password-btn:hover {
    color: #0077b6;
}

/* --- Force mot de passe --- */
#pwd_strength_msg {
    font-size: 0.85em;
    margin-top: 5px;
    min-height: 20px;
}

/* --- Newsletter opt-in --- */
.newsletter-optin {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.85em;
    color: #4a5568;
}
.newsletter-optin label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
}
.newsletter-optin input[type="checkbox"] {
    margin-top: 3px;
}

/* --- Titres de section dans le formulaire --- */
.modal-auth-form h4 {
    color: #0d47a1;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 5px;
    margin-top: 15px;
    margin-bottom: 12px;
    font-size: 1rem;
}

/* --- Scrollbar personnalisée pour modale inscription --- */
.modal-inscription-wide::-webkit-scrollbar {
    width: 8px;
}
.modal-inscription-wide::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.modal-inscription-wide::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}
.modal-inscription-wide::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* --- Responsive modal --- */
@media (max-width: 600px) {
    .modal-auth-content {
        width: 95%;
        padding: 20px 15px;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .type-compte-selector {
        flex-direction: column;
        gap: 10px;
    }
}
/* ==================== NETTOYAGE & HARMONISATION CSS ==================== */
.form-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.password-wrapper {
    position: relative;
}

.password-input {
    width: 100%;
    padding-right: 42px !important;
}

/* Version unifiée de .toggle-password-btn */
.toggle-password-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #0091ea;
    font-size: 0.85em;
    white-space: nowrap;
}

.toggle-password-btn:hover {
    color: #0077b6;
}

/* Classes utilitaires de couleur */
.text-success {
    color: #28a745;
}

.text-error {
    color: #e74c3c;
}

/* Alertes unifiées */
.alert-success-custom {
    margin-bottom: 12px;
    padding: 10px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    border-radius: 5px;
    font-size: 0.9rem;
}

.alert-error-custom {
    margin-top: 12px;
    color: #e74c3c;
    font-weight: bold;
}