:root {
    --lg-navy: #0a1730;
    --lg-navy-deep: #050c1c;
    --lg-blue: #1f6feb;
    --lg-blue-bright: #2e83ff;
    --lg-card: #101f3d;
    --lg-field: #16274a;
    --lg-border: #26375c;
    --lg-text: #eef3fb;
    --lg-muted: #90a2c0;
    --lg-red: #b91c1c;
    --lg-green: #16a34a;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, "Segoe UI", Arial, sans-serif;
    color: var(--lg-text);
    background: var(--lg-navy-deep);
}

/* =========================================================
   FOND — dégradé sombre + trame de points façon carte du monde
========================================================= */
.login-shell-v3 {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 18% 20%, rgba(46, 131, 255, 0.16), transparent 40%),
        radial-gradient(circle at 85% 75%, rgba(46, 131, 255, 0.10), transparent 45%),
        linear-gradient(160deg, var(--lg-navy) 0%, var(--lg-navy-deep) 100%);
    overflow: hidden;
}

.login-shell-v3::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.10) 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: 0.35;
    pointer-events: none;
}

/* Silhouette de ville + route stylisées en CSS pur (aucune photo requise) */
.login-skyline-v3 {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 34%;
    pointer-events: none;
    background:
        linear-gradient(0deg, rgba(5, 12, 28, 0.95), rgba(5, 12, 28, 0));
}

.login-skyline-v3::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 70%;
    background-color: #0c1a36;
    clip-path: polygon(
        0% 100%, 0% 55%, 4% 55%, 4% 30%, 9% 30%, 9% 60%, 15% 60%, 15% 15%, 20% 15%,
        20% 60%, 27% 60%, 27% 40%, 33% 40%, 33% 65%, 40% 65%, 40% 20%, 46% 20%,
        46% 60%, 53% 60%, 53% 35%, 59% 35%, 59% 70%, 66% 70%, 66% 25%, 72% 25%,
        72% 60%, 79% 60%, 79% 45%, 85% 45%, 85% 65%, 92% 65%, 92% 30%, 100% 30%, 100% 100%
    );
    opacity: 0.85;
}

/* =========================================================
   MISE EN PAGE GÉNÉRALE
========================================================= */
.login-content-v3 {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 18px;
}

.login-panel-v3 {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* =========================================================
   CARTE DE CONNEXION
========================================================= */
.login-card-v3 {
    width: 100%;
    text-align: center;
    background: var(--lg-card);
    border: 1px solid var(--lg-border);
    border-radius: 20px;
    padding: 30px 26px;
    box-shadow: 0 24px 60px rgba(2, 6, 18, 0.55);
    animation: cardEntrance 0.45s ease;
}

.login-logo-v3 {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    margin-bottom: 14px;
    animation: logoEntrance 0.6s ease;
}

.login-card-v3 h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
}

.login-subtitle-v3 {
    margin: 6px 0 24px;
    color: var(--lg-blue-bright);
    font-size: 14px;
    font-weight: 600;
}

.login-card-v3 form {
    text-align: left;
}

.input-icon-group-v3 {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--lg-field);
    border: 1px solid var(--lg-border);
    border-radius: 12px;
    padding: 0 14px;
    margin-bottom: 14px;
    transition: 0.15s ease;
}

.input-icon-group-v3:focus-within {
    border-color: var(--lg-blue-bright);
    box-shadow: 0 0 0 3px rgba(46, 131, 255, 0.22);
}

.input-icon-v3 {
    flex-shrink: 0;
    color: var(--lg-muted);
    font-size: 16px;
}

.input-icon-group-v3 input {
    flex: 1;
    min-height: 50px;
    border: none;
    background: transparent;
    color: var(--lg-text);
    font-size: 15px;
    outline: none;
}

.input-icon-group-v3 input::placeholder {
    color: var(--lg-muted);
}

/* Le bouton œil est injecté par login.js dans .password-wrapper */
.password-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
}

.password-wrapper input {
    flex: 1;
}

.password-toggle {
    flex-shrink: 0;
    width: 34px !important;
    height: 34px;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    color: var(--lg-muted) !important;
    border-radius: 8px;
    font-size: 16px;
    box-shadow: none;
}

.password-toggle:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

.login-options-v3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 4px 2px 20px;
    font-size: 13px;
    flex-wrap: wrap;
}

.remember-me-v3 {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--lg-muted);
    cursor: pointer;
    user-select: none;
}

.remember-me-v3 input {
    width: 16px;
    height: 16px;
    accent-color: var(--lg-blue-bright);
}

.link-btn-v3 {
    background: none;
    border: none;
    padding: 0;
    color: var(--lg-blue-bright);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    min-height: 0 !important;
    width: auto !important;
    margin: 0 !important;
}

.link-btn-v3:hover {
    text-decoration: underline;
}

.login-submit-v3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 50px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--lg-blue-bright), var(--lg-blue));
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.login-submit-v3:hover {
    filter: brightness(1.08);
}

.login-submit-v3:active {
    transform: translateY(1px);
}

.login-submit-v3:disabled {
    cursor: wait;
    opacity: 0.65;
}

.login-divider-v3 {
    position: relative;
    text-align: center;
    margin: 20px 0;
    color: var(--lg-muted);
    font-size: 12px;
    font-weight: 700;
}

.login-divider-v3::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--lg-border);
}

.login-divider-v3 span {
    position: relative;
    background: var(--lg-card);
    padding: 0 12px;
}

.login-offline-v3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    background: transparent;
    border: 1px solid var(--lg-blue-bright);
    border-radius: 12px;
    color: var(--lg-blue-bright);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.login-offline-v3:hover {
    background: rgba(46, 131, 255, 0.1);
}

.install-app-button {
    margin-top: 12px !important;
    width: 100% !important;
    min-height: 44px;
    background: rgba(46, 131, 255, 0.15) !important;
    border: 1px solid var(--lg-blue-bright) !important;
    color: var(--lg-blue-bright) !important;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

.install-app-button[hidden] {
    display: none !important;
}

#loginMessage {
    min-height: 0;
    margin-top: 14px;
    padding: 0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
}

#loginMessage.login-message {
    padding: 10px 12px;
}

#loginMessage.error {
    background: rgba(185, 28, 28, 0.18);
    color: #fca5a5;
}

#loginMessage.success {
    background: rgba(22, 163, 74, 0.18);
    color: #86efac;
}

#loginMessage.info {
    background: rgba(46, 131, 255, 0.14);
    color: #93c5fd;
}

/* =========================================================
   BADGES DE CONFIANCE + PIED DE PAGE
========================================================= */
.login-trust-v3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
    color: var(--lg-muted);
    font-size: 12px;
    flex-wrap: wrap;
}

.login-trust-v3 .sep {
    opacity: 0.4;
}

.login-copyright-v3 {
    margin: 14px 0 4px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 11px;
    text-align: center;
}

.login-footer-v3 {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 18px 22px;
}

.developer-credit {
    margin: 2px 0 0;
    color: rgba(255, 255, 255, 0.28);
    font-size: 10px;
    text-align: center;
}

.developer-credit strong {
    color: rgba(255, 255, 255, 0.4);
}

/* =========================================================
   PANNEAU HÉRO (ordinateur uniquement)
========================================================= */
.login-hero-v3 {
    display: none;
}

@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

/* =========================================================
   TABLETTE / GRAND MOBILE
========================================================= */
@media (min-width: 620px) {
    .login-card-v3 {
        padding: 40px 44px;
    }

    .login-logo-v3 {
        width: 116px;
        height: 116px;
    }

    .login-card-v3 h1 {
        font-size: 26px;
    }
}

/* =========================================================
   ORDINATEUR — panneau héro à gauche
========================================================= */
@media (min-width: 1000px) {
    .login-content-v3 {
        padding: 0;
        align-items: stretch;
        justify-content: center;
    }

    .login-shell-v3 {
        flex-direction: row;
    }

    .login-hero-v3 {
        display: flex;
        flex-direction: column;
        justify-content: center;
        width: 46%;
        max-width: 620px;
        padding: 60px 64px;
        position: relative;
        z-index: 1;
    }

    .login-hero-v3 h2 {
        margin: 0 0 14px;
        font-size: 34px;
        line-height: 1.2;
        color: #fff;
    }

    .login-hero-v3 > p {
        margin: 0 0 30px;
        color: var(--lg-muted);
        font-size: 15px;
        max-width: 420px;
        line-height: 1.6;
    }

    .login-hero-rule-v3 {
        width: 54px;
        height: 4px;
        border-radius: 999px;
        background: var(--lg-blue-bright);
        margin-bottom: 18px;
    }

    .login-features-v3 {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 18px;
        max-width: 420px;
    }

    .login-features-v3 li {
        display: flex;
        align-items: flex-start;
        gap: 14px;
    }

    .login-feature-icon-v3 {
        flex-shrink: 0;
        width: 40px;
        height: 40px;
        border-radius: 11px;
        background: rgba(46, 131, 255, 0.16);
        border: 1px solid rgba(46, 131, 255, 0.35);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 17px;
    }

    .login-features-v3 strong {
        display: block;
        color: #fff;
        font-size: 14px;
        margin-bottom: 2px;
    }

    .login-features-v3 small {
        color: var(--lg-muted);
        font-size: 13px;
        line-height: 1.5;
    }

    .login-content-v3 {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 40px;
    }

    .login-skyline-v3 {
        left: 0;
        width: 46%;
        right: auto;
        height: 60%;
        opacity: 0.6;
    }
}
