/* SafetyAI - Styles page de connexion */

/* ================================
   LAYOUT PRINCIPAL
================================ */

.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.auth-page.loaded {
    opacity: 1;
}

.auth-container {
    width: 100%;
    max-width: 1200px;
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 600px;
    transform: translateY(20px);
    animation: slideUp 0.6s ease-out forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
    }
}

/* ================================
   PANNEAU LATÉRAL (BRANDING)
================================ */

.auth-side-panel {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-side-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        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.05) 0%, transparent 50%);
    pointer-events: none;
}

.auth-branding {
    position: relative;
    z-index: 2;
}

.brand-logo {
    margin-bottom: 3rem;
}

.brand-logo i {
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.brand-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #fff, #f0f9ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    font-weight: 300;
}

/* Fonctionnalités */
.brand-features {
    margin-bottom: 3rem;
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.feature-item i {
    font-size: 1.2rem;
    margin-right: 1rem;
    min-width: 24px;
}

.feature-item span {
    font-weight: 500;
}

/* Statistiques */
.brand-stats {
    margin-top: auto;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--warning-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
    font-weight: 300;
}

/* ================================
   PANNEAU FORMULAIRE
================================ */

.auth-form-panel {
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fafafa;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
}

.auth-form-container {
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.auth-header {
    margin-bottom: 2rem;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    font-size: 1rem;
    line-height: 1.5;
}

/* ================================
   FORMULAIRE
================================ */

.form-group {
    position: relative;
}

.form-label {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.form-label i {
    color: var(--primary-color);
}

.input-group {
    position: relative;
}

.input-group-text {
    background: white;
    border-right: none;
    padding: 0.75rem 1rem;
    border-color: #e2e8f0;
}

.form-control {
    border-left: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control:focus + .input-group-text,
.input-group-text:has(+ .form-control:focus) {
    border-color: var(--primary-color);
}

/* Bouton toggle mot de passe */
#togglePassword {
    border-left: none;
    background: white;
    border-color: #e2e8f0;
    padding: 0.75rem;
}

#togglePassword:hover {
    background: var(--bg-secondary);
}

/* Options du formulaire */
.form-options {
    margin: 1.5rem 0;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

/* ================================
   BOUTONS
================================ */

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    padding: 0.875rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

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

.btn-primary.loading {
    pointer-events: none;
    opacity: 0.8;
}

/* États du bouton */
.button-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================================
   SÉPARATEUR
================================ */

.auth-divider {
    position: relative;
    text-align: center;
    margin: 2rem 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.auth-divider span {
    background: #fafafa;
    padding: 0 1rem;
    color: var(--secondary-color);
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
}

/* ================================
   CONNEXION SOCIALE
================================ */

.social-login .btn {
    border-color: #e2e8f0;
    color: var(--secondary-color);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.social-login .btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.social-login .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.social-login .btn small {
    display: block;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* ================================
   SWITCH D'AUTHENTIFICATION
================================ */

.auth-switch a {
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-switch a:hover {
    color: var(--primary-dark);
    text-decoration: underline !important;
}

/* ================================
   FOOTER
================================ */

.auth-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.auth-footer small {
    font-size: 0.8rem;
    line-height: 1.5;
}

.auth-footer a {
    color: var(--primary-color);
}

.auth-footer a:hover {
    color: var(--primary-dark);
}

/* ================================
   ALERTES
================================ */

.alert {
    border: none;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease-out;
}

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

.alert-danger {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #047857;
    border-left: 4px solid var(--success-color);
}

/* ================================
   ANIMATIONS DE CHARGEMENT
================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

/* ================================
   RESPONSIVE DESIGN
================================ */

/* Tablettes */
@media (max-width: 992px) {
    .auth-container {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
    
    .auth-side-panel {
        order: 2;
        padding: 2rem;
        min-height: 300px;
    }
    
    .auth-form-panel {
        order: 1;
        padding: 2rem;
    }
    
    .brand-title {
        font-size: 2rem;
    }
    
    .brand-features {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        margin-bottom: 2rem;
    }
    
    .feature-item {
        margin-bottom: 0.5rem;
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    .feature-item i {
        font-size: 1rem;
        margin-right: 0.5rem;
    }
}

/* Smartphones */
@media (max-width: 576px) {
    .auth-page {
        padding: 0.5rem;
    }
    
    .auth-container {
        border-radius: 1rem;
        margin: 0;
    }
    
    .auth-form-panel {
        padding: 1.5rem;
    }
    
    .auth-side-panel {
        padding: 1.5rem;
        min-height: 250px;
    }
    
    .auth-title {
        font-size: 1.75rem;
    }
    
    .brand-title {
        font-size: 1.75rem;
    }
    
    .brand-features {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .feature-item {
        justify-content: center;
        text-align: center;
        flex-direction: column;
        padding: 0.75rem;
    }
    
    .feature-item i {
        margin-right: 0;
        margin-bottom: 0.25rem;
    }
    
    .form-control,
    .input-group-text,
    .btn {
        font-size: 16px; /* Éviter le zoom sur iOS */
    }
    
    .btn-primary {
        padding: 1rem 2rem;
    }
}

/* Mode paysage sur smartphones */
@media (max-width: 768px) and (orientation: landscape) {
    .auth-container {
        grid-template-columns: 1fr 1fr;
        max-width: 900px;
    }
    
    .auth-side-panel {
        order: 1;
        padding: 1.5rem;
    }
    
    .auth-form-panel {
        order: 2;
        padding: 1.5rem;
    }
    
    .brand-features {
        display: none; /* Masquer pour économiser l'espace */
    }
    
    .brand-stats {
        margin-top: 1rem;
    }
}

/* ================================
   ANIMATIONS SPÉCIALES
================================ */

/* Animation de flottement pour le logo */
@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    25% { 
        transform: translateY(-10px) rotate(1deg); 
    }
    50% { 
        transform: translateY(-5px) rotate(0deg); 
    }
    75% { 
        transform: translateY(-15px) rotate(-1deg); 
    }
}

/* Animation pour les champs de formulaire */
.form-control:focus {
    animation: focusGlow 0.3s ease-out;
}

@keyframes focusGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }
}

/* Animation pour les boutons */
.btn:active {
    animation: buttonPress 0.1s ease-out;
}

@keyframes buttonPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.98); }
    100% { transform: scale(1); }
}

/* ================================
   ACCESSIBILITÉ
================================ */

/* Focus visible pour la navigation au clavier */
.form-control:focus,
.btn:focus,
.form-check-input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Améliorer le contraste pour les liens */
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Réduire les animations pour les utilisateurs sensibles */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .brand-logo i {
        animation: none;
    }
    
    .feature-item:hover {
        transform: none;
    }
}

/* ================================
   PRINT STYLES
================================ */

@media print {
    .auth-side-panel {
        display: none;
    }
    
    .auth-container {
        grid-template-columns: 1fr;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .loading-overlay {
        display: none;
    }
}