/* ===================================
   AUTH MODAL STYLES
   ================================= */

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.8) 100%);
    backdrop-filter: blur(15px);
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 25px;
    padding: 35px;
    max-width: 450px;
    width: 90%;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.3),
        0 15px 35px rgba(102, 126, 234, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transform: translateY(30px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.auth-modal.show .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.modal-content h2 {
    color: white;
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.9rem;
    font-weight: 800;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.5px;
    position: relative;
}

.modal-content h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    border-radius: 2px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group:last-of-type {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.3px;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(15px);
    box-shadow: 
        inset 0 1px 3px rgba(0, 0, 0, 0.1),
        0 1px 3px rgba(255, 255, 255, 0.1);
    position: relative;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 0 25px rgba(255, 255, 255, 0.3),
        0 0 40px rgba(79, 172, 254, 0.2),
        inset 0 1px 3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.form-group input:valid {
    border-color: rgba(56, 161, 105, 0.8);
}

/* Indicateurs de validation */
.form-group input:valid:not(:placeholder-shown) {
    border-color: rgba(72, 187, 120, 0.9);
    box-shadow: 
        0 0 15px rgba(72, 187, 120, 0.3),
        inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-group input:invalid:not(:placeholder-shown) {
    border-color: rgba(245, 101, 101, 0.8);
    box-shadow: 
        0 0 15px rgba(245, 101, 101, 0.3),
        inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Style pour les champs username */
input[name="username"] {
    background: rgba(255, 255, 255, 0.1);
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%);
}

/* Style pour les champs email */
input[type="email"] {
    background: rgba(79, 172, 254, 0.1);
}

/* Style pour les champs password */
input[type="password"] {
    background: rgba(166, 206, 57, 0.1);
    letter-spacing: 2px;
}

.btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    box-shadow: 
        0 8px 25px rgba(79, 172, 254, 0.4),
        0 3px 10px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 5px;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5fbcff 0%, #1af3fe 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 15px 40px rgba(79, 172, 254, 0.6),
        0 5px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.modal-footer {
    text-align: center;
    margin-top: 25px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.modal-footer a {
    color: #4facfe;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.modal-footer a:hover {
    color: #00f2fe;
    text-decoration: underline;
}

/* Messages de notification */
.auth-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 18px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    z-index: 10001;
    transform: translateX(100%);
    transition: all 0.3s ease;
    min-width: 300px;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    direction: rtl;
    text-align: right;
    font-family: 'Rubik', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.5;
    word-wrap: break-word;
}

.auth-message.show {
    transform: translateX(0);
}

.auth-message-success {
    background: linear-gradient(135deg, #38a169 0%, #48bb78 100%);
    border-right: 4px solid #2f855a;
    border-left: none;
    box-shadow: 0 10px 30px rgba(56, 161, 105, 0.4);
}

.auth-message-error {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    border-right: 4px solid #9b2c2c;
    border-left: none;
    box-shadow: 0 10px 30px rgba(229, 62, 62, 0.4);
}

.auth-message i {
    flex-shrink: 0;
    font-size: 1.3rem;
}

.auth-message span {
    flex: 1;
}

.auth-message-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    border-right: 4px solid #ffc107;
    border-left: none;
    color: #856404;
}

/* --- MESSAGE EMAIL NON VÉRIFIÉ --- */
.email-not-verified-message {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 0;
    direction: rtl;
    text-align: right;
}

.email-not-verified-message i {
    font-size: 1.5rem;
    margin-top: 2px;
    flex-shrink: 0;
    order: 2;
}

.message-content {
    flex: 1;
    direction: rtl;
    text-align: right;
}

.message-content strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 600;
    direction: rtl;
    text-align: right;
}

.message-content p {
    margin: 0 0 15px 0;
    font-size: 0.95rem;
    line-height: 1.4;
    opacity: 0.9;
    direction: rtl;
    text-align: right;
}

/* Style spécial pour le message de succès de vérification */
.auth-message-success.verification-success {
    background: linear-gradient(135deg, #38a169 0%, #48bb78 100%);
    border-right: 4px solid #2f855a;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(56, 161, 105, 0.3);
    animation: successPulse 2s ease-in-out;
}

.auth-message-success.verification-success i {
    font-size: 1.8rem;
    margin-left: 10px;
    margin-right: 0;
    color: #2f855a;
    animation: checkmarkBounce 0.6s ease-in-out;
}

/* Style pour le contenu du message de succès de vérification */
.verification-success-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 0;
    direction: rtl;
    text-align: right;
}

.verification-success-content i {
    font-size: 1.8rem;
    margin-top: 2px;
    flex-shrink: 0;
    order: 2;
    color: #2f855a;
    animation: checkmarkBounce 0.6s ease-in-out;
}

.verification-success-content .message-text {
    flex: 1;
    direction: rtl;
    text-align: right;
}

.verification-success-content .message-text strong {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 8px;
    font-weight: 700;
    direction: rtl;
    text-align: right;
    color: #2f855a;
}

.verification-success-content .message-text p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
    opacity: 0.95;
    direction: rtl;
    text-align: right;
    color: white;
}

@keyframes successPulse {
    0%, 100% {
        transform: translateX(0) scale(1);
    }
    50% {
        transform: translateX(0) scale(1.02);
    }
}

@keyframes checkmarkBounce {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.resend-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.resend-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.resend-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.resend-btn i {
    font-size: 0.9rem;
}

/* --- ANIMATION SPINNER --- */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        max-width: 400px;
        padding: 40px 35px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 25px 20px;
        margin: 15px;
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }
    
    .form-group {
        margin-bottom: 18px;
    }
    
    .form-group input {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
    
    .btn {
        padding: 12px 18px;
        font-size: 0.95rem;
    }
    
    .auth-message {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Animation d'entrée pour les modals */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-modal.show .modal-content {
    animation: modalSlideIn 0.4s ease-out;
}

/* Effet de particules pour le modal */
.modal-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #4facfe, #00f2fe, #667eea, #764ba2);
    border-radius: 22px;
    z-index: -1;
    opacity: 0.3;
    animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

/* Effet de particules flottantes */
.modal-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.3) 1px, transparent 1px),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.2) 1px, transparent 1px),
        radial-gradient(circle at 40% 60%, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px, 80px 80px, 60px 60px;
    animation: floatingParticles 15s linear infinite;
    pointer-events: none;
    border-radius: 25px;
    opacity: 0.6;
}

@keyframes floatingParticles {
    0% {
        transform: translateY(0px) rotate(0deg);
    }
    100% {
        transform: translateY(-20px) rotate(360deg);
    }
}

/* Animation de pulsation douce pour le modal */
@keyframes modalPulse {
    0%, 100% {
        box-shadow: 
            0 25px 50px rgba(0, 0, 0, 0.3),
            0 15px 35px rgba(102, 126, 234, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 
            0 30px 60px rgba(0, 0, 0, 0.4),
            0 20px 45px rgba(102, 126, 234, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

.auth-modal.show .modal-content {
    animation: modalSlideIn 0.4s ease-out, modalPulse 4s ease-in-out infinite 2s;
}

 