:root {
    --figa-green: #09933E;
    --figa-green-dark: #077533;
    --login-title: #4f5d73;
    --login-label: #64748b;
    --login-input-bg: #eef3f8;
    --login-input-border: #dfe6ee;
    --login-footer: #94a3b8;
    --login-badge-bg: #e8ecf1;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body.login-body {
    height: 100%;
    margin: 0;
}

body.login-body {
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #fff;
    color: #334155;
}

.figa-login {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

.figa-login__panel {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem 3rem;
}

.figa-login__inner {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.figa-login__branding {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    margin: 0 auto 2rem;
    background: #fff;
    border-radius: 0.9rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.figa-login__branding-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    flex-shrink: 0;
}

.figa-login__branding-text {
    font-size: clamp(0.62rem, 1.15vw, 0.84rem);
    font-weight: 700;
    color: var(--figa-green);
    line-height: 1.25;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.figa-login__branding-text .acronym {
    color: #E41F26;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 25px;
}

.figa-login__title {
    margin: 0 0 1.25rem;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--login-title);
}

.figa-login__field {
    margin-bottom: 1rem;
}

.figa-login__field label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.4rem;
    font-size: 13px;
    font-weight: 500;
    color: var(--login-label);
}

.figa-login__field label i {
    width: 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

.figa-login__input {
    display: block;
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--login-input-border);
    border-radius: 0.7rem;
    background: var(--login-input-bg);
    font-size: 13px;
    color: #1e293b;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.figa-login__input:focus {
    outline: none;
    border-color: #8fcea8;
    box-shadow: 0 0 0 0.2rem rgba(9, 147, 62, 0.16);
    background: #fff;
}

.figa-login__input.is-invalid {
    border-color: #dc3545;
}

.figa-login__invalid {
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    color: #dc3545;
}

.figa-login__button {
    display: block;
    width: 100%;
    margin-top: 1.75rem;
    padding: 1rem 1.25rem;
    border: 0;
    border-radius: 999px;
    background: var(--figa-green);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.figa-login__button:hover {
    background: var(--figa-green-dark);
}

.figa-login__button:active {
    transform: translateY(1px);
}

.figa-login__forgot {
    margin-top: 1.1rem;
    text-align: center;
}

.figa-login__forgot a {
    color: var(--figa-green);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
}

.figa-login__forgot a:hover {
    text-decoration: underline;
}

.figa-login__footer {
    margin-top: 2.25rem;
    text-align: center;
    color: var(--login-footer);
    font-size: 0.75rem;
    line-height: 1.6;
}

.figa-login__aside {
    display: none;
}

/* Badge circulaire — fond gris clair + ombre douce (comme la référence) */
.figa-login__badge {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--login-badge-bg);
    border-radius: 50%;
    overflow: hidden;
    box-shadow:
        0 0 0 10px rgba(148, 163, 184, 0.18),
        0 10px 28px rgba(15, 23, 42, 0.14);
}

.figa-login__badge img {
    width: 78%;
    height: 78%;
    object-fit: contain;
    display: block;
}

.figa-login__badge--mobile {
    width: 7.25rem;
    height: 7.25rem;
    margin: 0 auto 1.25rem;
}

.figa-login__badge--desktop {
    width: 12.5rem;
    height: 12.5rem;
}

@media (min-width: 800px) {
    body.login-body,
    .figa-login {
        background-color: var(--figa-green);
    }

    .figa-login {
        /*
         * Fond blanc à gauche plus large (~82%) pour reculer le vert :
         * la courbe traverse le centre du badge FIGA SIRH.
         */
        background-image: url('../images/blob.svg');
        background-repeat: no-repeat;
        background-position: left center;
        background-size: 82% 100%;
    }

    .figa-login__panel {
        width: 100%;
        max-width: none;
        justify-content: center;
        /* Décale légèrement vers la gauche (zone blanche) pour centrer le formulaire dans la page utile */
        padding: 2rem 28% 2rem 8%;
    }

    .figa-login__inner {
        max-width: 500px;
        margin: 0 auto;
    }

    .figa-login__badge--mobile {
        display: none;
    }

    .figa-login__aside {
        display: block;
        position: absolute;
        inset: 0;
        z-index: 1;
        pointer-events: none;
        background: transparent;
    }

    /*
     * Badge centré sur la frontière blanc/vert (~82% de la largeur) :
     * left = 82% - demi-largeur du badge.
     */
    .figa-login__badge--desktop {
        position: absolute;
        left: calc(82% - 6.25rem);
        top: 50%;
        transform: translateY(-50%);
        z-index: 3;
        pointer-events: auto;
    }
}

@media (min-width: 1100px) {
    .figa-login {
        background-size: 80% 100%;
    }

    .figa-login__panel {
        padding: 2.5rem 30% 2.5rem 10%;
    }

    .figa-login__badge--desktop {
        width: 14rem;
        height: 14rem;
        left: calc(80% - 7rem);
    }
}

@media (min-width: 1400px) {
    .figa-login {
        background-size: 78% 100%;
    }

    .figa-login__badge--desktop {
        left: calc(78% - 7rem);
    }
}

@media (max-width: 799.98px) {
    body.login-body {
        background: #fff;
    }

    .figa-login::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 26vh;
        min-height: 120px;
        background: var(--figa-green);
        mask-image: url('../images/blob-m.svg');
        mask-position: bottom center;
        mask-repeat: no-repeat;
        mask-size: cover;
        z-index: 0;
        pointer-events: none;
    }

    .figa-login__panel {
        z-index: 1;
    }
}
