/* ============================================
   VARIABLES ET RÉINITIALISATION GLOBALES
   ============================================ */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    
    --bg-light: #f8f9fa;
    --bg-lighter: #f7f7f7;
    --text-dark: #333333;
    --text-secondary: #6b7280;
    --text-muted: #999999;
    --border-color: #d9d9d9;
    --border-light: #e5e7eb;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-lighter);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   CONTENEUR PRINCIPAL D'AUTHENTIFICATION
   ============================================ */

.auth-container {
    display: flex;
    min-height: 100vh;
    background: var(--bg-lighter);
}

/* ============================================
   SECTION VISUELLE (GAUCHE)
   ============================================ */

.auth-visual {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 50%;
    background: var(--primary-gradient);
    padding: 60px 40px;
    color: white;
    position: relative;
    overflow: hidden;
}

.auth-visual::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    top: -100px;
    right: -50px;
    animation: float 20s infinite ease-in-out;
}

.auth-visual::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    bottom: -50px;
    left: -50px;
    animation: float 25s infinite ease-in-out reverse;
}

.auth-brand {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
    animation: pulse 4s ease-in-out infinite;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 1;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.6s ease-out forwards;
    opacity: 0;
}

.feature-item:nth-child(1) { animation-delay: 0.2s; }
.feature-item:nth-child(2) { animation-delay: 0.3s; }
.feature-item:nth-child(3) { animation-delay: 0.4s; }

.feature-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    opacity: 0.9;
}

.feature-item span {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.95;
}

/* ============================================
   SECTION FORMULAIRE (DROITE)
   ============================================ */

.auth-form-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 50%;
    padding: 40px;
    background: white;
}

.auth-form-container {
    width: 100%;
    max-width: 420px;
    animation: fadeInUp 0.6s ease-out;
}

.form-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.form-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ============================================
   GROUPE DE FORMULAIRE
   ============================================ */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    margin-left: 16px;
    margin-right: 8px;
    flex-shrink: 0;
    stroke-width: 2;
}

.form-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 14px;
    color: var(--text-dark);
    outline: none;
    font-family: inherit;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:autofill {
    -webkit-autofill-background-color: transparent !important;
    -webkit-text-fill-color: var(--text-dark) !important;
}

.toggle-password {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    transition: color var(--transition-normal);
    margin-right: 4px;
}

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

.toggle-password svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.form-error {
    font-size: 12px;
    color: var(--danger-color);
    display: none;
    animation: shake 0.4s ease-out;
}

.form-error.show {
    display: block;
}

/* ============================================
   OPTIONS DU FORMULAIRE
   ============================================ */

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label {
    color: var(--text-secondary);
    transition: color var(--transition-normal);
}

.checkbox-wrapper:hover .checkbox-label {
    color: var(--text-dark);
}

/* ============================================
   BOUTON DE SOUMISSION
   ============================================ */

.btn-submit {
    padding: 12px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius-lg);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    position: relative;
    overflow: hidden;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}

.btn-submit.loading .btn-loader {
    display: block;
}

.btn-submit.loading .btn-text {
    display: none;
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius-xl);
    max-width: 400px;
    width: 100%;
    padding: 32px;
    box-shadow: var(--shadow-xl);
    position: relative;
    animation: scaleIn 0.3s ease-out;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--bg-light);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
}

.modal-close:hover {
    background: var(--border-light);
    color: var(--text-dark);
}

.modal-close svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.modal-body {
    text-align: center;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ============================================
   RESPONSIVE - TABLETTE
   ============================================ */

@media (max-width: 1024px) {
    .auth-visual {
        padding: 50px 30px;
    }
    
    .auth-form-wrapper {
        padding: 30px;
    }
    
    .auth-form-container {
        max-width: 380px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }
    
    .auth-visual,
    .auth-form-wrapper {
        width: 100%;
        padding: 40px 24px;
    }
    
    .auth-visual {
        min-height: 280px;
        justify-content: flex-start;
        padding-top: 30px;
    }
    
    .auth-brand {
        margin-bottom: 40px;
    }
    
    .auth-logo {
        width: 60px;
        height: 60px;
    }
    
    .auth-title {
        font-size: 24px;
    }
    
    .auth-features {
        gap: 16px;
    }
    
    .form-title {
        font-size: 24px;
    }
    
    .auth-form-container {
        max-width: 100%;
    }
    
    .social-login {
        grid-template-columns: 1fr 1fr;
    }
    
    .modal-content {
        max-width: 90%;
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .auth-visual {
        padding: 30px 16px;
    }
    
    .auth-form-wrapper {
        padding: 24px 16px;
    }
    
    .auth-brand {
        margin-bottom: 32px;
    }
    
    .auth-logo {
        width: 50px;
        height: 50px;
    }
    
    .auth-title {
        font-size: 20px;
    }
    
    .auth-subtitle {
        font-size: 13px;
    }
    
    .form-title {
        font-size: 20px;
    }
    
    .form-subtitle {
        font-size: 13px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .input-wrapper {
        min-height: 44px;
    }
    
    .form-input {
        font-size: 16px;
    }
    
    .btn-submit {
        min-height: 48px;
        font-size: 13px;
    }
}

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

@media print {
    .auth-container {
        display: none;
    }
}
