/* CSS pour la page de connexion admin */

.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.login-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.6s ease-out;
    position: relative;
    z-index: 10;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--admin-primary), #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.login-logo i {
    font-size: 2rem;
    color: white;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--admin-text-primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--admin-text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

.login-form {
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 10;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--admin-text-primary);
    font-size: 0.875rem;
}

.form-group label i {
    color: var(--admin-primary);
    width: 16px;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    box-sizing: border-box;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.form-group input:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: white;
}

.form-group input.error {
    border-color: var(--admin-danger);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--admin-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--admin-transition);
}

.password-toggle:hover {
    color: var(--admin-primary);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--admin-text-secondary);
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    position: relative;
    transition: var(--admin-transition);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--admin-primary);
    border-color: var(--admin-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.forgot-link {
    color: var(--admin-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--admin-transition);
}

.forgot-link:hover {
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--admin-primary), #3b82f6);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

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

.login-footer {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.login-footer p {
    color: var(--admin-text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.back-link {
    color: var(--admin-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--admin-transition);
}

.back-link:hover {
    text-decoration: underline;
}

.login-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Alertes dans la page de connexion */
.login-card .alert {
    margin-bottom: 1.5rem;
    padding: 0.875rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card .alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.login-card .alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .login-logo {
        width: 60px;
        height: 60px;
    }
    
    .login-logo i {
        font-size: 1.5rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* Mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    .login-page {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    }
    
    .login-card {
        background: rgba(30, 41, 59, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .login-header h1 {
        color: white;
    }
    
    .login-header p {
        color: #cbd5e1;
    }
    
    .form-group label {
        color: white;
    }
    
    .form-group input {
        background: rgba(51, 65, 85, 0.8);
        border-color: #475569;
        color: white;
    }
    
    .form-group input::placeholder {
        color: #94a3b8;
    }
    
    .form-group input:focus {
        background: #334155;
    }
    
    .checkbox-label {
        color: #cbd5e1;
    }
    
    .checkmark {
        border-color: #475569;
    }
    
    .login-footer {
        border-top-color: #475569;
    }
    
    .login-footer p {
        color: #94a3b8;
    }
}

/* Animations de chargement */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Focus visible pour l'accessibilité */
.login-btn:focus-visible,
.form-group input:focus-visible,
.forgot-link:focus-visible,
.back-link:focus-visible {
    outline: 2px solid var(--admin-primary);
    outline-offset: 2px;
}


/* Corrections pour l'interactivité des champs */
.login-card * {
    pointer-events: auto;
}

.login-card input[type="text"],
.login-card input[type="password"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    cursor: text;
    pointer-events: auto !important;
    position: relative;
    z-index: 100;
}

.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus {
    pointer-events: auto !important;
    z-index: 101;
}

/* S'assurer que le conteneur n'interfère pas */
.login-container {
    pointer-events: auto;
}

.login-background {
    pointer-events: none;
}

.bg-pattern {
    pointer-events: none;
}

