/* ===================================
   RÉINITIALISATION ET BASE
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Couleurs principales - Synchronisées avec le site */
    --primary: #1F8BF1;
    --primary-light: #4DA3FF;
    --primary-dark: #1565C0;
    --secondary: #FF6B6B;
    --accent: #4ECDC4;
    --purple: #9B59B6;
    --orange: #FF9F43;

    /* Couleurs neutres */
    --dark: #101820;
    --dark-light: #1a2332;
    --muted: #6b7280;
    --bg: #f7fafc;
    --white: #ffffff;
    --surface-color: #ffffff;
    --text-primary: #101820;
    --text-secondary: #6b7280;
    --border-color: rgba(31, 139, 241, 0.15);

    /* Gradients du site */
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);

    /* États */
    --error-color: #FF6B6B;
    --error-bg: rgba(255, 107, 107, 0.1);
    --success-color: #43e97b;

    /* Ombres - Synchronisées avec le site */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 50px rgba(31, 139, 241, 0.15);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    font-family: 'Montserrat', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===================================
   WRAPPER PRINCIPAL
   =================================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 50%, #f093fb15 100%);
    overflow: hidden;
}

/* ===================================
   DÉCORATION ARRIÈRE-PLAN
   =================================== */
.background-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.05;
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 500px;
    height: 500px;
    background: var(--gradient-1);
    top: -250px;
    left: -250px;
    animation-delay: 0s;
}

.circle-2 {
    width: 400px;
    height: 400px;
    background: var(--gradient-4);
    bottom: -200px;
    right: -200px;
    animation-delay: -7s;
}

.circle-3 {
    width: 300px;
    height: 300px;
    background: var(--gradient-3);
    top: 50%;
    right: -150px;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
    }
    33% {
        transform: translateY(-30px) translateX(30px) scale(1.05);
    }
    66% {
        transform: translateY(30px) translateX(-30px) scale(0.95);
    }
}

/* ===================================
   CONTENEUR DE CONNEXION
   =================================== */
.login-container {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 10;
    box-shadow: var(--shadow-xl);
    border: 2px solid var(--border-color);
    backdrop-filter: blur(10px);
    animation: slideIn 0.6s ease-out;
}

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

/* ===================================
   EN-TÊTE
   =================================== */
.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo {
    display: inline-block;
    margin-bottom: 1.5rem;
    animation: logoEntrance 0.8s ease-out;
}

@keyframes logoEntrance {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.logo svg {
    display: block;
    filter: drop-shadow(0 4px 8px rgba(31, 139, 241, 0.3));
    transition: transform var(--transition-normal);
}

.logo:hover svg {
    transform: scale(1.05) rotate(5deg);
}

.login-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--gradient-3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ===================================
   MESSAGE D'ERREUR
   =================================== */
.error-message {
    background: var(--error-bg);
    border: 1px solid var(--error-color);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.error-message svg {
    color: var(--error-color);
    flex-shrink: 0;
}

.error-message span {
    color: var(--error-color);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===================================
   FORMULAIRE
   =================================== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-left: 0.25rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.input-wrapper input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    background: var(--bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-normal);
    outline: none;
}

.input-wrapper input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(31, 139, 241, 0.1);
}

.input-wrapper input:focus ~ .input-icon,
.input-wrapper input:focus + .input-icon {
    color: var(--primary);
}

/* ===================================
   OPTIONS DU FORMULAIRE
   =================================== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: -0.5rem;
}

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

.checkbox-wrapper input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-wrapper span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

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

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===================================
   BOUTON DE SOUMISSION
   =================================== */
.btn-submit {
    margin-top: 0.5rem;
    padding: 0.975rem 1.5rem;
    background: var(--gradient-3);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(31, 139, 241, 0.3);
    position: relative;
    overflow: hidden;
}

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

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(31, 139, 241, 0.4);
}

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

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

.btn-submit svg {
    transition: transform var(--transition-fast);
}

.btn-submit:hover svg {
    transform: translateX(4px);
}

/* ===================================
   PIED DE PAGE
   =================================== */
.login-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.login-footer p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.login-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 640px) {
    .login-wrapper {
        padding: 1rem;
    }

    .login-container {
        padding: 2rem 1.5rem;
        border-radius: var(--radius-lg);
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
    }

    .circle-1,
    .circle-2,
    .circle-3 {
        display: none;
    }
}

@media (max-width: 400px) {
    .login-container {
        padding: 1.5rem 1rem;
    }

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

    .btn-submit {
        padding: 0.875rem 1.25rem;
    }
}

/* ===================================
   ÉTATS DE CHARGEMENT (OPTIONNEL)
   =================================== */
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===================================
   ANIMATIONS D'ENTRÉE
   =================================== */
.form-group {
    animation: fadeInUp 0.6s ease-out backwards;
}

.form-group:nth-child(1) {
    animation-delay: 0.1s;
}

.form-group:nth-child(2) {
    animation-delay: 0.2s;
}

.form-options {
    animation: fadeInUp 0.6s ease-out 0.3s backwards;
}

.btn-submit {
    animation: fadeInUp 0.6s ease-out 0.4s backwards;
}

.login-footer {
    animation: fadeInUp 0.6s ease-out 0.5s backwards;
}

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

