/* Variables CSS pour la page de login */
:root {
    --primary: #00d4aa;
    --primary-dark: #00b894;
    --primary-light: #00f5d4;
    --secondary: #0984e3;
    --secondary-dark: #0770c4;
    --accent: #6c5ce7;
    --accent-dark: #5649c2;
    
    --dark: #0a0f1c;
    --dark-light: #1a2332;
    --dark-lighter: #2d3748;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #cbd5e1;
    --gray-dark: #475569;
    
    --success: #00d4aa;
    --warning: #fdcb6e;
    --error: #e74c3c;
    --info: #3498db;
    
    --gradient-primary: linear-gradient(135deg, var(--primary), var(--accent));
    --gradient-secondary: linear-gradient(135deg, var(--secondary), var(--primary));
    --gradient-dark: linear-gradient(135deg, var(--dark), var(--dark-light));
    --gradient-ocean: linear-gradient(135deg, #00d4aa, #0984e3, #6c5ce7);
    
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 20px rgba(0, 212, 170, 0.3);
    
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET GARANTI ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* GARANTIE que tout est cliquable et sélectionnable */
html, body {
    pointer-events: auto !important;
    user-select: text !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--dark);
    color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: default !important;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ===== BACKGROUND ===== */
.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none !important; /* Ne bloque pas les clics */
}

#loginCanvas {
    width: 100%;
    height: 100%;
    background: var(--dark);
    pointer-events: none !important;
}

.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 212, 170, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(9, 132, 227, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(108, 92, 231, 0.06) 0%, transparent 50%);
    pointer-events: none !important;
}

/* ===== SPLASH SCREEN (CORRIGÉ) ===== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-ocean);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: splashOut 0.5s ease-in-out 2s forwards;
    pointer-events: none !important; /* CRITIQUE: Ne bloque pas après disparition */
}

.splash-content {
    text-align: center;
    color: white;
    pointer-events: none;
}

.splash-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    justify-content: center;
    pointer-events: none;
}

.splash-logo i {
    font-size: 3rem;
    animation: pulse 2s infinite;
}

.splash-tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
    pointer-events: none;
}

@keyframes splashOut {
    0% { 
        opacity: 1; 
        transform: scale(1); 
        pointer-events: auto;
    }
    99% { 
        opacity: 0; 
        transform: scale(1.1); 
        pointer-events: none;
    }
    100% { 
        opacity: 0; 
        transform: scale(1.1); 
        display: none !important; 
        pointer-events: none !important;
        visibility: hidden !important;
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ===== MAIN CONTAINER ===== */
.login-container {
    width: 100%;
    max-width: 440px;
    padding: 2rem;
    position: relative;
    pointer-events: auto !important;
    z-index: 1;
}

/* ===== LOGIN CARD ===== */
.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
    pointer-events: auto !important;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    pointer-events: none;
}

/* ===== HEADER ===== */
.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
    pointer-events: auto;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--light);
    pointer-events: auto;
}

.brand-logo i {
    color: var(--primary);
    font-size: 1.8rem;
}

.login-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    pointer-events: auto;
}

.login-header p {
    color: var(--gray);
    font-size: 0.95rem;
    pointer-events: auto;
}

/* ===== MESSAGE TEMPORAIRE ===== */
.temporary-notice {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    color: #ffc107;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    animation: pulse 2s infinite;
    pointer-events: auto;
}

/* ===== FORMULAIRE ===== */
.login-form {
    margin-bottom: 2rem;
    pointer-events: auto !important;
}

.form-group {
    margin-bottom: 1.5rem;
    pointer-events: auto !important;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--gray-light);
    pointer-events: auto;
    cursor: text !important;
}

.form-group label i {
    color: var(--primary);
    width: 16px;
}

/* ===== INPUTS (GARANTIS ÉCRITABLES) ===== */
.form-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    color: var(--light);
    font-size: 0.95rem;
    transition: var(--transition);
    pointer-events: auto !important;
    cursor: text !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
    cursor: text !important;
}

.form-group input::placeholder {
    color: var(--gray);
}

.form-group input:valid {
    border-color: rgba(0, 212, 170, 0.3);
}

/* ===== PASSWORD INPUT ===== */
.password-input {
    position: relative;
    pointer-events: auto !important;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer !important;
    padding: 0.25rem;
    transition: var(--transition);
    pointer-events: auto !important;
    z-index: 10;
}

.toggle-password:hover {
    color: var(--primary);
}

.input-feedback {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    min-height: 1rem;
    pointer-events: none;
}

.input-feedback.error {
    color: var(--error);
}

.input-feedback.success {
    color: var(--success);
}

/* ===== FORM OPTIONS ===== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    pointer-events: auto !important;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer !important;
    color: var(--gray-light);
    pointer-events: auto !important;
}

.checkbox input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    pointer-events: auto !important;
}

.checkbox input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer !important;
    pointer-events: auto !important;
}

.forgot-password:hover {
    color: var(--primary-light);
}

/* ===== BOUTON PRINCIPAL (GARANTI CLIQUABLE) ===== */
.btn-login {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer !important; /* FORCE */
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    pointer-events: auto !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent;
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed !important;
    transform: none;
}

.btn-loading {
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.btn-login.loading .btn-text {
    display: none;
}

.btn-login.loading .btn-loading {
    display: flex;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    pointer-events: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== DIVIDER ===== */
.login-divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    color: var(--gray);
    font-size: 0.9rem;
    pointer-events: none;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.login-divider span {
    padding: 0 1rem;
}

/* ===== BOUTONS SOCIAUX (GARANTIS CLIQUABLES) ===== */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: auto !important;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.05);
    color: var(--light);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer !important; /* FORCE */
    transition: var(--transition);
    pointer-events: auto !important;
}

.btn-social:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-google:hover {
    border-color: #DB4437;
}

.btn-microsoft:hover {
    border-color: #0078D4;
}

/* ===== SECURITY INFO ===== */
.security-info {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    pointer-events: auto;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray);
    font-size: 0.85rem;
    pointer-events: auto;
}

.security-item:not(:last-child) {
    margin-bottom: 0.75rem;
}

.security-item i {
    color: var(--primary);
    width: 16px;
}

/* ===== FOOTER ===== */
.login-footer {
    text-align: center;
    pointer-events: auto !important;
}

.signup-link {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    pointer-events: auto;
}

.signup-btn {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 0.25rem;
    transition: var(--transition);
    cursor: pointer !important;
    pointer-events: auto !important;
}

.signup-btn:hover {
    color: var(--primary-light);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 0.85rem;
    pointer-events: auto !important;
}

.footer-links a {
    color: var(--gray);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    cursor: pointer !important;
    pointer-events: auto !important;
}

.footer-links a:hover {
    color: var(--primary);
}

/* ===== DEMO CREDENTIALS ===== */
.demo-credentials {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2rem;
    backdrop-filter: blur(10px);
    pointer-events: auto !important;
}

.demo-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    pointer-events: auto;
}

.demo-info {
    text-align: center;
    pointer-events: auto;
}

.demo-info p {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    pointer-events: auto;
}

.demo-link {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    margin-top: 10px;
    transition: var(--transition);
    cursor: pointer !important;
    pointer-events: auto !important;
}

.demo-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===== ANIMATIONS ===== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    animation: slideIn 0.6s ease-out;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .login-container {
        padding: 1rem;
        max-width: 100%;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
    }
    
    .splash-logo {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .splash-logo i {
        font-size: 2.5rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .form-options {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem 1rem;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .brand-logo {
        font-size: 1.3rem;
    }
    
    .demo-credentials {
        padding: 1rem;
    }
}

/* ===== ÉTATS DE VALIDATION ===== */
.form-group.valid input {
    border-color: var(--success);
}

.form-group.invalid input {
    border-color: var(--error);
}

/* ===== EFFETS ===== */
.login-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
    pointer-events: none !important;
}

@keyframes shimmer {
    0% { transform: rotate(45deg) translateX(-100%); }
    100% { transform: rotate(45deg) translateX(100%); }
}

/* ===== CORRECTIONS FINALES GARANTIES ===== */

/* GARANTIE que tous les boutons sont cliquables */
button, a[href], input[type="button"], input[type="submit"] {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* GARANTIE que tous les inputs sont éditables */
input[type="text"], 
input[type="email"], 
input[type="password"], 
input[type="number"], 
textarea, 
select {
    cursor: text !important;
    pointer-events: auto !important;
    user-select: text !important;
    -webkit-user-select: text !important;
}

/* Supprime tout ce qui pourrait bloquer */
*[style*="pointer-events: none"]:not(.splash-screen):not(.login-background):not(.gradient-overlay) {
    pointer-events: auto !important;
}

/* S'assurer qu'aucun élément ne couvre les autres */
.login-container > * {
    position: relative;
    z-index: 10;
}

/* Correction pour mobile */
@media (hover: none) and (pointer: coarse) {
    .btn-login:active,
    .btn-social:active,
    .demo-link:active {
        transform: scale(0.98) !important;
    }
}

/* Debug visuel (optionnel) */
.debug-click {
    outline: 2px solid lime !important;
}