/* --- 1. Variables & Reset --- */
:root {
    --brand-dark: #1a252f;       /* Fond principal */
    --brand-dark-gradient: linear-gradient(135deg, #1a252f 0%, #2c3e50 100%);
    --brand-blue: #2980b9;       /* Boutons */
    --accent-orange: #e67e22;    /* Détails */
    --white: #ffffff;
    --card-bg: #ffffff;
    --text-dark: #333333;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Roboto', sans-serif;
    height: 100vh;
    width: 100%;
    /* C'est ici qu'on applique le fond sombre PARTOUT */
    background: var(--brand-dark-gradient);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Motif de fond subtil (points) pour l'aspect technique */
.bg-overlay-pattern {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: 0;
}

/* --- 2. Layout Principal (Flexbox) --- */
.main-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1; /* Au-dessus du motif de fond */
}

/* --- 3. Colonne Gauche (40%) - Logo --- */
.left-section {
    width: 40%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    /* Pas de background ici, car le body gère le fond */
}

.brand-content {
    text-align: center;
}

.brand-logo {
    width: 160px; /* Taille ajustée */
    margin-bottom: 25px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}

.brand-text h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.tagline {
    font-size: 1rem;
    color: #bdc3c7; /* Gris clair */
    font-style: italic;
    position: relative;
    display: inline-block;
}
.tagline::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--accent-orange);
    margin: 10px auto 0;
}

/* --- 4. Colonne Droite (60%) - Formulaire --- */
.right-section {
    width: 60%;
    display: flex;
    justify-content: center; /* Centre la carte horizontalement dans les 60% */
    align-items: center;     /* Centre la carte verticalement */
    padding: 20px;
}

/* La Carte Blanche */
.login-card {
    background: var(--card-bg);
    color: var(--text-dark); /* Le texte redevient noir dans la carte blanche */
    width: 100%;
    max-width: 450px;
    padding: 50px;
    border-radius: 15px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4); /* Grosse ombre pour l'effet "flottant" */
}

.form-header {
    margin-bottom: 30px;
}

.form-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--brand-dark);
    margin-bottom: 8px;
}

.form-header p {
    color: #7f8c8d;
    font-size: 0.95rem;
}

/* --- Formulaire --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--brand-dark);
}

.form-group input {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: 0.3s;
    background: #f9f9f9;
}

.form-group input:focus {
    border-color: var(--brand-blue);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
}

.btn-login {
    width: 100%;
    padding: 16px;
    background-color: var(--brand-dark); /* Bouton sombre pour rappeler le fond */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    margin-top: 10px;
}

.btn-login:hover {
    background-color: var(--accent-orange); /* Devient orange au survol */
    transform: translateY(-2px);
}

.error-message {
    background: #ffecec;
    color: #d63031;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    border-left: 4px solid #d63031;
    display: flex; gap: 10px; align-items: center;
}

.footer-copy {
    margin-top: 30px;
    text-align: center;
    font-size: 0.8rem;
    color: #b2bec3;
}

/* --- Responsive Mobile --- */
@media (max-width: 900px) {
    .main-wrapper {
        flex-direction: column;
        overflow-y: auto; /* Permettre le scroll sur mobile */
    }

    .left-section {
        width: 100%;
        height: auto;
    }
    
    .brand-logo { width: 100px; }
    .brand-text h1 { font-size: 1.5rem; }

    .right-section {
        width: 100%;
        padding: 20px;
    }

    .login-card {
        padding: 30px;
    }
}