:root {
    /* Same blues as the rest of Mon Dossier (buttons #007EA8, hover #2A647A) */
    --md-blue: #007EA8;
    --md-blue-fonce: #2A647A;
    --cote-gris: #333333;
}

html, body {
    height: 100%;
}

body.login-page {
    margin: 0;
    font-family: 'Roboto', system-ui, -apple-system, sans-serif;
    color: var(--cote-gris);
    background-color: #fff;
}

.login-split {
    display: flex;
    min-height: 100vh;
}

.brand-panel {
    flex: 1.15;
    position: relative;
    overflow: hidden;
    background-color: var(--md-blue);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 3rem 2rem;
}

.brand-panel .circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    pointer-events: none;
    animation: loginBubbleDrift 11s linear infinite;
    will-change: transform;
}

.brand-panel .circle-1 {
    width: 55vmin;
    height: 55vmin;
    top: -18vmin;
    right: -14vmin;
    animation-duration: 12s;
}

.brand-panel .circle-2 {
    width: 70vmin;
    height: 70vmin;
    bottom: -30vmin;
    left: -22vmin;
    animation-duration: 15s;
    animation-delay: -6s;
}

.brand-panel .circle-3 {
    width: 18vmin;
    height: 18vmin;
    bottom: 12vmin;
    right: 8vmin;
    background: rgba(255, 255, 255, 0.10);
    animation-duration: 8s;
    animation-delay: -3s;
}

/* Closed loop so the motion never pauses to reverse direction. */
@keyframes loginBubbleDrift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    25% {
        transform: translate3d(7%, -5%, 0) scale(1.05);
    }
    50% {
        transform: translate3d(2%, -10%, 0) scale(1.08);
    }
    75% {
        transform: translate3d(-6%, -4%, 0) scale(1.03);
    }
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
}

.brand-panel img.brand-logo {
    position: relative;
    width: min(380px, 72%);
    height: auto;
    margin: 1.5rem 0 2rem;
}

.brand-panel .tagline {
    position: relative;
    font-weight: 900;
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    letter-spacing: 0.01em;
    text-align: center;
    margin: 0;
}

.brand-panel .subline {
    position: relative;
    font-weight: 400;
    font-size: 1rem;
    opacity: 0.9;
    text-align: center;
    margin: 0.6rem 0 0;
    max-width: 22rem;
}

.form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 1.5rem 1.25rem;
}

.form-box {
    width: 100%;
    max-width: 400px;
    margin-top: auto;
    margin-bottom: auto;
    animation: loginFadeInUp 0.45s ease-out both;
}

@keyframes loginFadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.form-box h1 {
    font-weight: 900;
    font-size: 1.75rem;
    color: var(--cote-gris);
    margin-bottom: 0.25rem;
}

.form-box h1::after {
    content: "";
    display: block;
    width: 48px;
    height: 4px;
    border-radius: 2px;
    background: var(--md-blue);
    margin-top: 0.6rem;
}

.form-box p.lead-text {
    color: #6c757d;
    font-size: 0.95rem;
    margin: 1rem 0 1.5rem;
}

.form-box label,
.form-box .form-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--cote-gris);
}

.form-box .asteriskField {
    display: none;
}

.form-box .form-control,
.form-box input[type="text"],
.form-box input[type="password"],
.form-box input[type="email"],
.form-box input[type="number"] {
    display: block;
    width: 100%;
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    height: auto;
    font-size: 1rem;
    border: 1px solid #d9dee3;
    background-color: #fff;
    color: var(--cote-gris);
}

.form-box .form-control:focus,
.form-box input[type="text"]:focus,
.form-box input[type="password"]:focus,
.form-box input[type="email"]:focus,
.form-box input[type="number"]:focus {
    border-color: var(--md-blue);
    box-shadow: 0 0 0 0.2rem rgba(0, 126, 168, 0.2);
    outline: none;
}

.form-box .login-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.form-box .btn-primary {
    background-color: var(--md-blue);
    border: none;
    border-radius: 10px;
    font-weight: 700;
    padding: 0.7rem 1rem;
    flex: 1 1 160px;
    color: #fff;
}

.form-box .btn-primary:hover,
.form-box .btn-primary:focus,
.form-box .btn-primary:active {
    background-color: var(--md-blue-fonce);
    color: #fff;
}

.form-box .btn-secondary,
.form-box .btn-link {
    border-radius: 10px;
}

.form-box .btn-link {
    color: var(--md-blue-fonce);
    font-weight: 500;
    text-decoration: none;
    padding-left: 0;
    padding-right: 0;
}

.form-box .btn-link:hover,
.form-box .btn-link:focus {
    color: var(--md-blue);
}

.form-box .alert {
    border-radius: 10px;
    font-size: 0.9rem;
}

.form-box .login-flash {
    width: 100%;
    margin-bottom: 1.25rem;
}

.form-box .other-devices {
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.form-box .other-devices button {
    margin: 0.25rem 0.25rem 0 0;
}

.form-box .forgot-password {
    margin: 0.85rem 0 0;
    text-align: center;
}

.form-box .forgot-password a {
    font-size: 0.8rem;
    color: var(--md-blue-fonce);
    font-weight: 500;
    text-decoration: none;
}

.form-box .forgot-password a:hover {
    text-decoration: underline;
}

.form-box .backup-form {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e9ecef;
}

.form-box .invalid-feedback,
.form-box .errorlist {
    color: #dc3545;
    font-size: 0.85rem;
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.form-footer {
    width: 100%;
    max-width: 420px;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: #adb5bd;
    text-align: center;
}

.form-footer p {
    margin: 0 0 0.35rem;
}

.form-footer a {
    color: var(--md-blue);
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

.form-footer .footer-sep {
    margin: 0 0.35rem;
}

.form-footer .copy-line {
    margin-top: 0.6rem;
}

@media (max-width: 767.98px) {
    .login-split {
        flex-direction: column;
    }

    .brand-panel {
        flex: none;
        padding: 2rem 1.5rem 1.75rem;
    }

    .brand-panel img.brand-logo {
        width: min(220px, 68%);
        margin: 0 0 0.85rem;
    }

    .brand-panel .circle-2 {
        width: 40vmin;
        height: 40vmin;
    }

    .form-panel {
        padding-top: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .form-box,
    .brand-panel .circle {
        animation: none;
    }
}
