/* =========================================================================
   VARIABLES & REINITIALISATION SYSTEME
   ========================================================================= */
:root {
    /* Couleurs principales */
    --login-primary: #d9232d;
    --login-blue: #155eef;
    --login-dark-bg: #172033;
    
    /* Nuances de gris */
    --login-text: #344054;
    --login-muted: #6b7280;
    --login-border: #dce3ed;
    --login-bg: #f3f4f6;

    /* Typographie Bootstrap native */
    --login-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

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

body {
    font-family: var(--login-font-family);
    background: var(--login-bg);
    color: var(--login-text);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* =========================================================================
   LAYOUT PRINCIPAL
   ========================================================================= */
.login-page {
    min-height: 100vh;
    padding: 24px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-shell {
    width: 100%;
    max-width: 900px; /* Plus compact */
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(17, 24, 39, 0.08); /* Plus discret */
}

/* =========================================================================
   PANNEAU INSTITUTIONNEL (GAUCHE)
   ========================================================================= */
.login-brand {
    padding: 36px; /* Plus compact */
    /* Dégradé diagonal plus doux */
    background: linear-gradient(135deg, #0f172a, var(--login-primary));
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

/* Cercles décoratifs plus discrets */
.login-brand::before,
.login-brand::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

.login-brand::before {
    width: 200px;
    height: 200px;
    right: -80px;
    top: 60px;
}

.login-brand::after {
    width: 300px;
    height: 300px;
    right: -120px;
    bottom: -100px;
}

.brand-content,
.brand-footer {
    position: relative;
    z-index: 1;
}

/* Logo */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px; /* Plus compact */
}

.brand-logo-icon {
    width: 48px; /* Plus compact */
    height: 48px;
    border-radius: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.brand-logo-title {
    font-size: 19px; /* Plus compact */
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    color: #fff;
}

.brand-logo-subtitle {
    color: #d1d5db;
    font-size: 12px;
    margin-top: 1px;
}

/* Titre principal */
.brand-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 20px;
}

.brand-heading {
    font-size: 26px; /* Plus compact */
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    color: #fff;
}

.brand-description {
    font-size: 14px; /* Plus compact */
    line-height: 1.7;
    color: #e5e7eb;
    max-width: 370px;
}

/* Liste des fonctionnalités */
.brand-features {
    display: grid;
    gap: 12px; /* Plus compact */
    margin-top: 28px;
}

.brand-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #f3f4f6;
}

.brand-feature-icon {
    width: 32px; /* Plus compact */
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 15px;
    flex-shrink: 0;
}

/* Pied de page de marque */
.brand-footer {
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11px;
    color: #d1d5db;
    font-weight: 500;
}

/* =========================================================================
   PANNEAU DE CONNEXION (DROITE)
   ========================================================================= */
.login-panel {
    padding: 44px; /* Plus compact */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-heading {
    margin-bottom: 28px;
}

.login-icon {
    width: 48px; /* Plus compact */
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #eaf1ff;
    color: var(--login-primary);
    font-size: 22px;
    margin-bottom: 20px;
}

.login-title {
    color: var(--login-dark-bg);
    font-size: 24px; /* Plus compact */
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.login-subtitle {
    color: var(--login-muted);
    font-size: 13.5px;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Éléments de formulaire */
.login-label {
    display: block;
    color: var(--login-text);
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--login-border);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: all 0.2s ease;
}

.login-input-group:focus-within {
    border-color: var(--login-blue);
    box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.1);
}

.login-input-group .input-icon {
    width: 44px; /* Plus compact */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aaba;
    font-size: 16px;
}

.login-input-group .form-control {
    min-height: 46px; /* Plus compact */
    border: 0;
    box-shadow: none;
    font-size: 14px;
    padding: 0 12px 0 0;
    color: var(--login-dark-bg);
}

.login-input-group .form-control:focus {
    box-shadow: none;
    background-color: transparent;
}

.login-input-group .form-control::placeholder {
    color: #a0aaba;
    font-weight: 400;
}

.login-input-group .password-toggle {
    border: 0;
    background: transparent;
    color: #778399;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
}

.login-input-group .password-toggle:hover {
    color: var(--login-blue);
}

.login-field {
    margin-bottom: 20px;
}

/* Se souvenir de moi */
.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--login-text);
    font-size: 13px;
    font-weight: 500;
}

.login-remember .form-check-input {
    margin: 0;
    width: 15px;
    height: 15px;
    cursor: pointer;
    border-radius: 4px;
    border-color: var(--login-border);
}

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

/* Bouton soumettre */
.login-submit {
    min-height: 48px; /* Plus compact */
    border: 0;
    border-radius: 10px;
    background: var(--login-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(21, 94, 239, 0.15);
}

.login-submit:hover {
    background: var(--login-primary);
    color: #fff;
    transform: translateY(-1px);
}

.login-submit:disabled {
    opacity: 0.7;
    transform: none;
    cursor: wait;
}

/* Bloc sécurité */
.login-security {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 24px;
    padding: 14px;
    border: 1px solid #eef2f8;
    background: #fcfdfe;
    border-radius: 12px;
}

.login-security-icon {
    color: var(--login-blue);
    font-size: 18px;
    flex-shrink: 0;
}

.login-security-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--login-dark-bg);
    margin-bottom: 3px;
}

.login-security-text {
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--login-muted);
    margin: 0;
}

/* Footer de page */
.login-bottom {
    margin-top: 24px;
    text-align: center;
    color: #a0aaba;
    font-size: 11px;
    font-weight: 500;
}

/* Alerte Bootstrap custom */
.login-alert {
    border-radius: 10px;
    font-size: 13px;
    padding: 12px 16px;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 850px) {
    .login-shell {
        grid-template-columns: 1fr;
        max-width: 480px;
    }

    .login-brand {
        padding: 28px;
    }

    .login-panel {
        padding: 32px;
    }
}