:root {
    --primary-color: #0d6efd;
    --primary-dark: #0a58ca;
    --secondary-color: #3786fd;
    --accent-color: #d1dce5;
    --light-bg: #f4f7f9;
    --card-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    --border-radius: 16px;
    --input-radius: 10px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #f0f4f8 0%, #d7e1ec 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #333;
}

/* Wrapper Principal */
.login-wrapper {
    display: flex;
    width: 100%;
    max-width: 980px;
    min-height: 580px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: #ffffff;
    box-shadow: var(--card-shadow);
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Section Gauche (Bannière / Présentation) */
.left-section {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.left-section::before,
.left-section::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.left-section::before {
    width: 280px;
    height: 280px;
    top: -80px;
    right: -80px;
}

.left-section::after {
    width: 180px;
    height: 180px;
    bottom: -60px;
    left: -60px;
}

.logo-container {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    position: relative;
    z-index: 2;
}

.logo-img {
    height: 120px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.left-section h2 {
    font-weight: 700;
    font-size: 28px;
    line-height: 1.3;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.left-section p {
    font-size: 15px;
    line-height: 1.6;
    opacity: 0.92;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

.features {
    position: relative;
    z-index: 2;
}

.feature {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    font-size: 14px;
}

.feature i {
    font-size: 16px;
    margin-right: 12px;
    background: rgba(255, 255, 255, 0.15);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Section Droite (Formulaire) */
.right-section {
    flex: 1.1;
    background: white;
    padding: 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.back-to-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: #6c757d;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-to-home:hover {
    color: var(--primary-color);
}

.right-section h3 {
    font-weight: 700;
    font-size: 26px;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.right-section p.subtitle {
    color: #6c757d;
    margin-bottom: 25px;
    font-size: 14px;
}

/* Champs de formulaire */
.form-container {
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #343a40;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Conteneurs d'input relatifs pour alignement parfait */
.input-field-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-field-wrapper input {
    width: 100%;
    padding: 13px 45px 13px 16px;
    border: 1.5px solid #dee2e6;
    border-radius: var(--input-radius);
    font-size: 15px;
    background-color: #f8f9fa;
    transition: all 0.25s ease;
    color: #212529;
}

.input-field-wrapper input:focus {
    background-color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12);
    outline: none;
}

/* Positionnement dynamique des icônes */
.input-icon,
.toggle-password {
    position: absolute;
    right: 15px;
    color: #adb5bd;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.toggle-password {
    pointer-events: auto;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}

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

/* Options & Bouton */
.options {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 22px;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    transition: color 0.2s;
}

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

.btn-login {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--input-radius);
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(13, 110, 253, 0.35);
}

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

.register-link {
    text-align: center;
    font-size: 14px;
    color: #6c757d;
    margin-top: 20px;
}

.register-link a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}

.register-link a:hover {
    text-decoration: underline;
}

/* Alerts */
.alert {
    border-radius: var(--input-radius);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    border: none;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
}

.alert-info {
    background-color: #cff4fc;
    color: #055160;
}

/* =================================================== */
/* RESPONSIVE DESIGN (Tablettes et Téléphones)        */
/* =================================================== */

@media (max-width: 850px) {
    body {
        padding: 12px;
    }

    .login-wrapper {
        flex-direction: column;
        max-width: 480px;
        min-height: auto;
    }

    /* Optimisation sur Mobile : Bannière compacte */
    .left-section {
        padding: 30px 25px;
        text-align: center;
        align-items: center;
    }

    .logo-container {
        justify-content: center;
        margin-bottom: 12px;
    }

    .logo-img {
        height: 90px;
    }

    .left-section h2 {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .left-section p {
        font-size: 13px;
        margin-bottom: 0;
    }

    /* On cache les puces 'features' sur mobile pour gagner de l'espace vertical */
    .features {
        display: none;
    }

    .right-section {
        padding: 30px 25px;
    }

    .right-section h3 {
        font-size: 22px;
    }
}

@media (max-width: 400px) {
    .left-section, .right-section {
        padding: 25px 18px;
    }
}