/* =========================================
   OHDB - STYLES DES MODALES (Global Sci-Fi)
   ========================================= */

/* Base style for the modal (initially hidden) */
.modal {
    visibility: hidden; 
    opacity: 0;
    
    /* On retarde la disparition (visibility) pour laisser l'opacité se fondre à la fermeture */
    transition: visibility 0s 0.3s, opacity 0.3s ease-in-out; 
    
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(5, 7, 10, 0.85); /* Fond assombri tech */
    backdrop-filter: blur(4px);
}

.modal.open {
    visibility: visible; 
    opacity: 1;
    /* À l'ouverture, la visibilité est immédiate, l'opacité prend 0.3s */
    transition: visibility 0s 0s, opacity 0.3s ease-in-out; 
}
  
/* --- CONTENEUR PRINCIPAL DES MODALES (Login, Register, Premium, etc.) --- */
.modal-content {
    background-color: #0b0c10; /* Noir profond */
    color: #e9e9e9;
    margin: 10% auto; /* Centrage */
    padding: 35px 30px;
    
    /* Design High-Tech */
    border: 1px solid rgba(104, 253, 214, 0.2);
    border-top: 4px solid #68fdd6; /* Accent Cyan */
    border-radius: 4px; /* Angles stricts */
    box-shadow: 0 15px 50px rgba(0,0,0,0.9), inset 0 0 20px rgba(104, 253, 214, 0.05);
    
    width: 90%; 
    max-width: 420px; 
    position: relative;
    overflow: hidden; /* Pour couper les scanlines */
    
    /* Animation d'entrée */
    transform: translateY(20px) scale(0.95); 
    opacity: 0; 
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease-out; 
}

/* Lignes de terminal / Scanlines (Effet global) */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    opacity: 0.3;
    z-index: 0;
}

/* Protection du contenu au-dessus des scanlines */
.modal-content > * {
    position: relative;
    z-index: 2;
}
  
.modal.open .modal-content {
    transform: translateY(0) scale(1); 
    opacity: 1; 
}
  
.login-form,
.register-form,
.forgot-password-form {
    display: none;
}

/* --- BOUTON DE FERMETURE --- */
.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    color: rgba(104, 253, 214, 0.5);
    font-size: 32px;
    line-height: 1;
    font-weight: normal;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    z-index: 10;
}
  
.close-button:hover,
.close-button:focus {
    color: #68fdd6;
    text-decoration: none;
    transform: rotate(90deg);
    text-shadow: 0 0 10px rgba(104, 253, 214, 0.5);
}
  
/* --- TYPOGRAPHIE GLOBALE --- */
.modal-content h2,
.premium-title {
    text-align: center;
    margin: 0 0 25px 0;
    color: #68fdd6;
    font-family: 'h73bold', sans-serif;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 1.5rem;
    text-shadow: 0 0 15px rgba(104, 253, 214, 0.3);
}

.modal-header-premium {
    text-align: center;
    margin-bottom: 20px;
}
  
.form-description {
    color: #8b949e;
    text-align: center;
    margin-bottom: 20px;
    font-size: 0.9em;
    font-family: 'h73light', sans-serif;
    line-height: 1.5;
}
  
/* --- FORMULAIRES (Inputs Sci-Fi) --- */
.form-group {
    margin-bottom: 20px;
}
  
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    background-color: rgba(15, 20, 25, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    color: #e9e9e9; 
    font-size: 1em;
    font-family: 'h73light', sans-serif;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}
  
.form-group input:focus {
    outline: none;
    border-color: #68fdd6;
    background-color: rgba(20, 25, 35, 0.9);
    box-shadow: 0 0 10px rgba(104, 253, 214, 0.2), inset 0 0 5px rgba(104, 253, 214, 0.1);
}

/* --- BOUTON PRINCIPAL (Login/Register) --- */
.btn-primary {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 10px;
    background: linear-gradient(135deg, rgba(104, 253, 214, 0.15) 0%, rgba(15, 20, 25, 0.8) 100%);
    color: #68fdd6;
    border: 1px solid rgba(104, 253, 214, 0.4);
    border-radius: 2px;
    font-size: 1rem;
    font-family: 'h73bold', sans-serif;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(104, 253, 214, 0.3) 0%, rgba(20, 30, 35, 0.9) 100%);
    box-shadow: 0 5px 15px rgba(104, 253, 214, 0.2), inset 0 0 10px rgba(104, 253, 214, 0.2);
    color: #fff;
    text-shadow: 0 0 8px rgba(104, 253, 214, 0.5);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.8);
}

/* Liens secondaires */
.forgot-password,
.switch-to-register,
.switch-to-login {
    text-align: center;
    margin-top: 15px;
    font-size: 0.85em;
    font-family: 'h73light', sans-serif;
}

.forgot-password a,
.switch-to-register a,
.switch-to-login a {
    color: #8892b0;
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-password a:hover,
.switch-to-register a:hover,
.switch-to-login a:hover {
    color: #68fdd6;
    text-decoration: underline;
}

/* Messages d'erreur et succès */
.error-message {
    color: #ff5252;
    text-align: center;
    margin-bottom: 15px;
    font-size: 0.9em;
    background: rgba(255, 82, 82, 0.1);
    padding: 10px;
    border-left: 3px solid #ff5252;
}

.success-message {
    color: #68fdd6;
    text-align: center;
    margin-bottom: 15px;
    font-size: 0.9em;
    background: rgba(104, 253, 214, 0.1);
    padding: 10px;
    border-left: 3px solid #68fdd6;
}

/* Visibilité mot de passe */
.password-input-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
    color: #8b949e;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: #68fdd6;
}

@media (max-height: 600px) {
    .modal-content {
        margin-top: 5%;
    }
}


/* =========================================
   DESIGN PREMIUM : MODALE DE LANGUES
   ========================================= */

.custom-lang-grid {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    gap: 20px !important;
    margin-top: 25px;
}

.lang-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    
    background: linear-gradient(135deg, rgba(15, 20, 25, 0.8) 0%, rgba(10, 12, 16, 0.9) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 2px !important;
    padding: 15px 20px !important;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    min-width: 160px;
    flex: 1;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5) !important;
}

/* Ligne lumineuse de sélection (gauche) */
.lang-card::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: transparent;
    transition: all 0.3s ease;
}

/* Effet au survol */
.lang-card:hover {
    background: linear-gradient(135deg, rgba(25, 30, 35, 0.9) 0%, rgba(15, 18, 22, 1) 100%) !important;
    border-color: rgba(104, 253, 214, 0.4) !important;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5), inset 0 0 15px rgba(104, 253, 214, 0.1) !important;
}

.lang-card:hover::after {
    background: rgba(104, 253, 214, 0.5);
    box-shadow: 0 0 8px rgba(104, 253, 214, 0.5);
}

/* Style de la carte ACTIVE */
.lang-card.active {
    background: linear-gradient(135deg, rgba(20, 35, 30, 0.9) 0%, rgba(12, 22, 18, 1) 100%) !important;
    border-color: #68fdd6 !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5), inset 0 0 20px rgba(104, 253, 214, 0.15) !important;
}

.lang-card.active::after {
    width: 4px;
    background: #68fdd6;
    box-shadow: 0 0 10px #68fdd6;
}

/* Typographie interne */
.lang-card-info {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.lang-card-info h3 {
    margin: 0;
    font-family: 'h73bold', sans-serif !important;
    font-size: 1.05rem;
    color: #e6edf3;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.lang-card.active .lang-card-info h3 {
    color: #68fdd6;
    text-shadow: 0 0 8px rgba(104, 253, 214, 0.4);
}

.lang-card-flag {
    margin-right: 15px;
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.5);
    padding: 4px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.lang-card:hover .lang-card-flag {
    border-color: rgba(104, 253, 214, 0.5);
}

.lang-card.active .lang-card-flag {
    border-color: #68fdd6;
    box-shadow: 0 0 10px rgba(104, 253, 214, 0.3);
}

.lang-card-flag img {
    width: 32px;
    height: auto;
    border-radius: 2px;
    display: block;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lang-card:hover .lang-card-flag img {
    transform: scale(1.1);
}

/* =========================================
   MODALE DE SUPPRESSION ISOLÉE (Anti-Conflit)
   ========================================= */

.oh-delete-modal {
    position: fixed;
    top: 0; left: 0; 
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

.oh-delete-modal.active {
    visibility: visible;
    opacity: 1;
}

.oh-delete-modal .oh-modal-content {
    background: #0b0c10;
    border: 1px solid rgba(104, 253, 214, 0.2);
    border-top: 4px solid #ff5252;
    box-shadow: 0 15px 50px rgba(0,0,0,0.9), inset 0 0 20px rgba(255, 82, 82, 0.05);
    width: 90%;
    max-width: 420px;
    padding: 35px 25px;
    position: relative;
    overflow: hidden;
    
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 20px !important;
    
    transform: translateY(30px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.oh-delete-modal.active .oh-modal-content {
    transform: translateY(0) scale(1);
}

.oh-header, .oh-body, .oh-footer {
    position: relative;
    z-index: 2;
    width: 100%;
    text-align: center;
    margin: 0 !important;
}

.oh-scanlines {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    opacity: 0.3;
    z-index: 1;
}

.oh-header {
    margin-bottom: 20px;
}

.oh-hazard-icon svg {
    width: 50px; height: 50px;
    margin: 0 auto 10px auto;
    display: block;
    filter: drop-shadow(0 0 8px rgba(255, 82, 82, 0.6));
    animation: pulseHazard 2s infinite;
}

.oh-title {
    font-family: 'h73bold', sans-serif;
    color: #ff5252;
    letter-spacing: 3px;
    font-size: 1.5rem;
    margin: 0;
}

.oh-body {
    margin-bottom: 25px;
}

.oh-body p {
    color: #e0e6ed;
    font-size: 1.1rem;
    font-family: 'h73light', sans-serif;
    margin: 0 0 15px 0;
}

.oh-sub-text {
    display: block;
    font-size: 0.85rem;
    color: #a8b2c1;
    background: rgba(255, 82, 82, 0.05);
    padding: 10px;
    border-left: 3px solid #ff5252;
    font-family: 'h73light', sans-serif;
}

/* BOUTONS SCI-FI AVEC PROFONDEUR 3D */
.oh-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px !important;
}

.oh-btn {
    flex: 1;
    position: relative;
    padding: 14px 15px;
    font-family: 'h73bold', sans-serif;
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: none !important;
    border-radius: 0 !important;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
    cursor: pointer;
    transition: all 0.15s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bouton Annuler */
.oh-btn-cancel {
    color: #8892b0;
    background: linear-gradient(135deg, #2a2d35 0%, #16181d 100%);
    box-shadow: inset 1px 1px 1px rgba(255, 255, 255, 0.1), inset -3px -5px 6px rgba(0, 0, 0, 0.7);
}

.oh-btn-cancel:hover {
    background: linear-gradient(135deg, #323640 0%, #1a1c23 100%);
    color: #68fdd6;
}

/* Bouton Danger */
.oh-btn-danger {
    color: #ff5252;
    background: linear-gradient(135deg, rgba(255, 82, 82, 0.25) 0%, rgba(100, 10, 10, 0.4) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 82, 82, 0.3), inset 1px 1px 2px rgba(255, 120, 120, 0.2), inset -3px -5px 6px rgba(0, 0, 0, 0.6);
}

.oh-btn-danger:hover {
    background: linear-gradient(135deg, #ff5252 0%, #c21a1a 100%);
    color: #0b0c10;
    box-shadow: inset 1px 1px 3px rgba(255, 255, 255, 0.4), inset -3px -5px 6px rgba(0, 0, 0, 0.5);
}

/* Effet de Clic */
.oh-btn:active {
    transform: translateY(4px) scale(0.98);
    box-shadow: inset 2px 4px 8px rgba(0, 0, 0, 0.8), inset -1px -1px 2px rgba(255, 255, 255, 0.05) !important;
}

@keyframes pulseHazard {
    0% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.8; transform: scale(1); }
}