.modern-login-page {
    min-height: 100dvh;
    background: #07364a url("dossier/fond_decran.jpg") center / cover fixed no-repeat;
}

.modern-login-shell {
    position: relative;
    isolation: isolate;
    width: 100%;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 36px 22px;
    perspective: 1500px;
}

.modern-login-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -3;
    background:
        radial-gradient(circle at 16% 18%, rgba(255, 165, 0, .38), transparent 31%),
        radial-gradient(circle at 85% 82%, rgba(9, 83, 112, .72), transparent 38%),
        linear-gradient(135deg, rgba(3, 31, 45, .74), rgba(7, 54, 74, .52));
    backdrop-filter: blur(4px);
}

.modern-login-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    opacity: .18;
    background-image:
        linear-gradient(rgba(255, 255, 255, .18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .18) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.login-scene,
.login-scene span {
    position: absolute;
    pointer-events: none;
}

.login-scene {
    inset: 0;
    z-index: -1;
    overflow: hidden;
    transform-style: preserve-3d;
}

.scene-ring {
    border: 2px solid rgba(255, 213, 128, .48);
    border-radius: 50%;
    box-shadow: inset 0 0 30px rgba(255, 165, 0, .14), 0 0 32px rgba(255, 165, 0, .12);
}

.scene-ring-one {
    width: 370px;
    height: 370px;
    top: -180px;
    right: -70px;
    border-left-color: rgba(255, 255, 255, .9);
    animation: scene-rotate 18s linear infinite;
}

.scene-ring-two {
    width: 280px;
    height: 280px;
    left: -100px;
    bottom: -105px;
    border-right-color: rgba(255, 165, 0, .95);
    animation: scene-rotate 15s linear infinite reverse;
}

.scene-orb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 25%, #fff, #ffb228 38%, #a95700 78%);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .35);
    animation: orb-float 5s ease-in-out infinite alternate;
}

.scene-orb-one {
    top: 18%;
    left: 9%;
}

.scene-orb-two {
    right: 8%;
    bottom: 16%;
    width: 14px;
    height: 14px;
    animation-delay: -2s;
}

.legacy-login.modern-login-card {
    --tilt-x: 0deg;
    --tilt-y: 0deg;
    width: min(940px, 100%);
    max-width: 940px;
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    margin: auto;
    padding: 0;
    overflow: visible;
    color: #263944;
    background: rgba(247, 250, 252, .96);
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 30px;
    box-shadow:
        0 36px 80px rgba(0, 20, 31, .42),
        0 9px 0 rgba(3, 39, 55, .3),
        inset 0 1px 0 rgba(255, 255, 255, .9);
    backdrop-filter: blur(22px);
    transform-style: preserve-3d;
    transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
    transition: transform .18s ease-out;
    animation: login-fade .35s ease-out;
}

.modern-login-card .login-showcase {
    position: relative;
    min-width: 0;
    overflow: hidden;
    padding: 36px 34px 32px;
    color: #fff;
    background:
        radial-gradient(circle at 85% 8%, rgba(255, 213, 128, .65), transparent 32%),
        linear-gradient(145deg, rgba(255, 176, 20, .98), rgba(247, 154, 0, .98) 52%, rgba(241, 157, 26, .98) 115%);
    border-radius: 29px 0 0 29px;
    text-align: center;
    transform: translateZ(18px);
    transform-style: preserve-3d;
}

.login-showcase::before,
.login-showcase::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 50%;
    pointer-events: none;
}

.login-showcase::before {
    width: 280px;
    height: 280px;
    top: -170px;
    left: -115px;
    box-shadow: 0 0 0 22px rgba(255, 255, 255, .04), 0 0 0 46px rgba(255, 255, 255, .025);
}

.login-showcase::after {
    width: 190px;
    height: 190px;
    right: -110px;
    bottom: -70px;
    box-shadow: 0 0 0 20px rgba(255, 255, 255, .04);
}

.modern-login-card .login-kicker {
    position: relative;
    z-index: 1;
    margin: 0 0 20px;
    color: #263944;
    font-size: 13px !important;
    font-weight: 800;
    letter-spacing: 2.4px;
}

.emblem-disc {
    position: relative;
    z-index: 1;
    width: 150px;
    height: 150px;
    display: grid;
    place-items: center;
    margin: 12px auto 30px;
    border: 1px solid rgba(255, 255, 255, .88);
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(255, 255, 255, .96), rgba(255, 213, 128, .72));
    box-shadow:
        0 16px 0 rgba(119, 72, 0, .2),
        0 28px 42px rgba(55, 36, 0, .3),
        inset 5px 5px 12px rgba(255, 255, 255, .9),
        inset -7px -8px 16px rgba(185, 123, 0, .16);
    transform-style: preserve-3d;
    animation: emblem-float 4.5s ease-in-out infinite alternate;
}

.emblem-disc::before {
    content: "";
    position: absolute;
    inset: -14px;
    border: 2px solid rgba(255, 255, 255, .56);
    border-top-color: #fff;
    border-bottom-color: rgba(9, 83, 112, .55);
    border-radius: 50%;
    transform: translateZ(-12px);
}

.emblem-disc::after {
    content: "";
    position: absolute;
    left: 18%;
    right: 18%;
    bottom: -42px;
    height: 18px;
    border-radius: 50%;
    background: rgba(39, 35, 22, .24);
    filter: blur(8px);
    transform: translateZ(-30px) rotateX(72deg);
}

.emblem-core {
    width: 102px;
    height: 102px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 8px 18px rgba(85, 54, 0, .2), inset 0 0 0 5px rgba(255, 165, 0, .13);
    transform: translateZ(34px);
}

.emblem-core img.avatar {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: none;
}

.modern-login-card .login-showcase h1 {
    position: relative;
    z-index: 1;
    margin: 0;
    color: #17394b;
    font-size: 40px !important;
    line-height: 1.1 !important;
    letter-spacing: -1px;
    text-shadow: 0 2px 0 rgba(255, 255, 255, .35), 0 8px 18px rgba(78, 48, 0, .16);
}

.modern-login-card .login-company {
    position: relative;
    z-index: 1;
    margin: 8px 0 0;
    color: #253b47;
    font-size: 18px !important;
    font-weight: 800;
}

.modern-login-card .login-intro {
    position: relative;
    z-index: 1;
    max-width: 300px;
    margin: 18px auto 24px;
    color: rgba(23, 57, 75, .9);
    font-size: 15px !important;
    line-height: 1.55;
}

.login-feature-list {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 18px 0 0;
    border-top: 1px solid rgba(255, 255, 255, .38);
    list-style: none;
    text-align: left;
}

.login-feature-list li {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #17394b;
    font-size: 14px;
    font-weight: 700;
}

.login-feature-list i {
    width: 22px;
    color: #253b47;
    text-align: center;
}

.modern-login-card .modern-login-panel {
    min-width: 0;
    padding: 34px 40px 24px;
    background: rgba(255, 255, 255, .88);
    border-radius: 0 29px 29px 0;
    transform: translateZ(28px);
}

.login-form-heading {
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-form-icon {
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, #ffb310, #ed8b00);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 15px;
    box-shadow: 0 6px 0 #b86c00, 0 11px 20px rgba(255, 165, 0, .24);
    font-size: 21px;
    transform: translateZ(12px);
}

.login-form-heading p {
    margin: 0 0 2px;
    color: #916000;
    font-size: 11px !important;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.modern-login-card .login-form-heading h2 {
    margin: 0;
    color: #17394b;
    font-size: 30px !important;
    line-height: 1.15 !important;
}

.modern-login-card .login-form-subtitle {
    margin: 16px 0 20px;
    color: #5a6a72;
    font-size: 14px !important;
}

.modern-login-card .alert-danger {
    margin: 0 0 16px;
    box-shadow: 0 4px 12px rgba(180, 35, 24, .08);
}

.legacy-login .modern-login-fields {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.login-field-group {
    margin-bottom: 15px;
}

.modern-login-card .login-label {
    display: inline-block;
    margin: 0 0 6px 2px;
    color: #334d5b;
    font-size: 13px !important;
    font-weight: 800;
}

.modern-login-card .modern-field {
    display: flex;
    width: 100%;
    min-height: 50px;
    margin: 0;
    overflow: hidden;
    background: rgba(244, 247, 249, .94);
    border: 1px solid rgba(72, 96, 110, .2);
    border-radius: 12px;
    box-shadow: inset 0 2px 4px rgba(23, 57, 75, .04), 0 3px 0 rgba(23, 57, 75, .05);
    transition: transform .18s ease-out, border-color .18s, box-shadow .18s;
}

.modern-login-card .modern-field:focus-within {
    border-color: rgba(255, 153, 0, .9);
    box-shadow: 0 0 0 4px rgba(255, 165, 0, .13), 0 5px 0 rgba(255, 165, 0, .1);
    transform: translateY(-1px) translateZ(6px);
}

.modern-login-card .modern-field .input-group-text {
    flex: 0 0 46px;
    min-width: 46px;
    min-height: 48px;
    justify-content: center;
    color: #c67600;
    background: transparent;
    border: 0;
}

.modern-login-card .modern-field .form-control {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
    height: 48px;
    min-height: 48px;
    padding: 10px 12px 10px 0;
    color: #203b49;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    outline-offset: -3px;
}

.modern-login-card .modern-field .form-control::placeholder {
    color: #77868d;
    opacity: 1;
}

.modern-login-card .modern-field select.form-control {
    padding-left: 0;
    cursor: pointer;
}

.modern-login-card .modern-field .password-toggle {
    width: 46px;
    min-width: 46px;
    padding: 0;
    color: #526b78;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.modern-login-card .modern-field .password-toggle:hover {
    color: #b56700;
    background: rgba(255, 165, 0, .08);
}

.modern-login-card .modern-submit {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 4px;
    padding: 13px 19px;
    overflow: hidden;
    color: #17394b;
    background: linear-gradient(115deg, #ffb21a, #f99b00 62%, #095370 180%);
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 12px;
    box-shadow: 0 7px 0 #a96000, 0 13px 24px rgba(170, 96, 0, .24);
    letter-spacing: .8px;
    transform: translateZ(10px);
    transition: transform .16s ease-out, box-shadow .16s, filter .16s;
}

.modern-login-card .modern-submit span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.modern-login-card .modern-submit:hover {
    color: #17394b;
    background: linear-gradient(115deg, #ffbd38, #ffa810 62%, #095370 180%);
    box-shadow: 0 9px 0 #a96000, 0 17px 28px rgba(170, 96, 0, .28);
    filter: saturate(1.06);
    transform: translateY(-2px) translateZ(14px);
}

.modern-login-card .modern-submit:active {
    box-shadow: 0 2px 0 #a96000, 0 6px 12px rgba(170, 96, 0, .2);
    transform: translateY(5px) translateZ(4px);
}

.legacy-login .modern-login-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 20px;
    padding: 16px 0 0;
    background: transparent;
    border-top: 1px solid rgba(54, 80, 94, .12);
}

.modern-login-card .modern-login-actions .cancelbtn {
    width: auto;
    min-height: 44px;
    padding: 8px 15px;
    color: #4d626d;
    background: rgba(237, 241, 244, .9);
    border: 1px solid rgba(65, 89, 102, .14);
    border-radius: 9px;
    box-shadow: 0 3px 0 rgba(50, 72, 84, .12);
    font-size: 14px !important;
    letter-spacing: 0;
}

.modern-login-card .modern-login-actions .cancelbtn:hover {
    color: #243f4e;
    background: #e4eaee;
    transform: translateY(-1px);
}

.modern-login-card .modern-login-actions .psw {
    padding: 0;
    text-align: right;
}

.modern-login-card .modern-login-actions a {
    color: #095370;
    font-size: 13px !important;
    font-weight: 700;
    text-decoration: none;
}

.modern-login-card .modern-login-actions a:hover {
    color: #a96000;
    text-decoration: underline;
}

.modern-login-card .login-access-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 18px 0 0;
    color: #6b7b83;
    font-size: 12px !important;
    text-align: center;
}

.login-access-note i {
    color: #b87613;
}

@keyframes login-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes emblem-float {
    from { transform: translateY(0) rotateX(3deg) rotateY(-5deg); }
    to { transform: translateY(-10px) rotateX(-2deg) rotateY(5deg); }
}

@keyframes scene-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes orb-float {
    from { transform: translateY(0) scale(.94); }
    to { transform: translateY(-24px) scale(1.06); }
}

@media (max-width: 760px) {
    .modern-login-page {
        background-attachment: scroll;
    }

    .modern-login-shell {
        overflow: hidden;
        padding: 22px 14px 28px;
        perspective: none;
    }

    .legacy-login.modern-login-card {
        width: min(520px, 100%);
        grid-template-columns: 1fr;
        border-radius: 25px;
        transform: none;
        transform-style: flat;
    }

    .modern-login-card .login-showcase {
        padding: 23px 24px 20px;
        border-radius: 24px 24px 0 0;
        transform: none;
    }

    .modern-login-card .login-showcase::before,
    .modern-login-card .login-showcase::after {
        display: none;
    }

    .modern-login-card .login-kicker {
        margin-bottom: 12px;
        font-size: 11px !important;
    }

    .emblem-disc {
        width: 88px;
        height: 88px;
        margin: 7px auto 20px;
        box-shadow: 0 9px 0 rgba(119, 72, 0, .2), 0 17px 26px rgba(55, 36, 0, .26), inset 4px 4px 9px rgba(255, 255, 255, .9);
        animation: none;
    }

    .emblem-disc::before {
        inset: -9px;
    }

    .emblem-disc::after {
        bottom: -28px;
        height: 12px;
    }

    .emblem-core {
        width: 66px;
        height: 66px;
        transform: none;
    }

    .emblem-core img.avatar {
        width: 57px;
        height: 57px;
    }

    .modern-login-card .login-showcase h1 {
        font-size: 30px !important;
    }

    .modern-login-card .login-company {
        font-size: 16px !important;
    }

    .modern-login-card .login-intro {
        margin: 10px auto 0;
        font-size: 14px !important;
    }

    .login-feature-list {
        display: none;
    }

    .modern-login-card .modern-login-panel {
        padding: 25px 24px 21px;
        border-radius: 0 0 24px 24px;
        transform: none;
    }

    .login-scene {
        display: none;
    }
}

@media (max-width: 420px) {
    .modern-login-shell {
        padding-inline: 10px;
    }

    .modern-login-card .login-showcase {
        padding-inline: 18px;
    }

    .modern-login-card .modern-login-panel {
        padding: 23px 18px 19px;
    }

    .login-form-icon {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
        border-radius: 13px;
    }

    .modern-login-card .login-form-heading h2 {
        font-size: 27px !important;
    }

    .login-form-heading p {
        font-size: 10px !important;
        letter-spacing: 1px;
    }

    .legacy-login .modern-login-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 12px;
    }

    .modern-login-card .modern-login-actions .cancelbtn {
        width: 100%;
    }

    .modern-login-card .modern-login-actions .psw {
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .modern-login-card,
    .emblem-disc,
    .scene-ring,
    .scene-orb {
        animation: none !important;
    }

    .legacy-login.modern-login-card {
        transform: none !important;
    }
}
