:root {
    --login-green: #087b61;
    --login-deep: #034b3f;
    --login-gold: #d4a84d;
    --login-ink: #102f32;
    --login-muted: #72818f;
}

*, *::before, *::after { 
    box-sizing: border-box; 
}

html { 
    min-height: 100%; 
}

body.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    font-family: 'Hind Siliguri', 'Inter', sans-serif;
    color: var(--login-ink);
    background-color: #032d2f;
    background-image:
        linear-gradient(135deg, rgba(1, 23, 29, .27), rgba(0, 51, 42, .12)),
        url('../images/login-background.webp?v=20261011-2158');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

.login-stage {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 24px 18px 54px;
    isolation: isolate;
}

.login-stage::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(ellipse at center, rgba(0, 24, 27, .04) 0%, rgba(0, 20, 24, .20) 100%);
    pointer-events: none;
}

.login-card {
    position: relative;
    width: min(552px, calc(100vw - 32px));
    max-width: 100%;
    max-height: calc(100dvh - 92px);
    overflow-y: auto;
    padding: clamp(25px, 2.5vw, 34px) clamp(24px, 2.5vw, 38px) 24px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .985), rgba(252, 254, 253, .97));
    border: 1px solid rgba(239, 213, 154, .95);
    border-radius: 28px;
    box-shadow: 0 26px 75px rgba(0, 17, 21, .40), 0 5px 16px rgba(5, 111, 89, .13), inset 0 1px 0 #fff;
    scrollbar-width: thin;
    scrollbar-color: #c8ddd7 transparent;
}

.login-card::before {
    content: '';
    position: absolute;
    left: 22px;
    right: 22px;
    top: 0;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, transparent, var(--login-gold), #fff0ba, var(--login-gold), transparent);
}

.login-brand { 
    text-align: center; 
    margin-bottom: 27px; 
}

.login-logo-wrap {
    width: 90px;
    height: 90px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 25px;
    background: linear-gradient(145deg, #f1fbf6, #ffffff);
    border: 1px solid #e8d39e;
    box-shadow: 0 8px 22px rgba(5, 105, 82, .12), inset 0 0 0 4px rgba(224, 194, 120, .13);
}

.login-logo {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: block;
    padding: 8px;
    object-fit: contain;
    object-position: center;
}

.login-logo-fallback {
    color: var(--login-green);
    font-size: 48px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-brand h1 {
    margin: 0;
    font-size: clamp(24px, 2.15vw, 32px);
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: -.4px;
    color: #0b3333;
    overflow-wrap: anywhere;
}

.login-subtitle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    color: #586d7d;
    font-size: 14px;
    font-weight: 500;
}

.login-subtitle span {
    display: inline-block;
    width: 36px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--login-gold));
}

.login-subtitle span:last-child { 
    transform: rotate(180deg); 
}

.login-description {
    margin: 8px 0 0;
    color: #8a969d;
    font-size: 12px;
}

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    border-radius: 12px;
    padding: 11px 13px;
    margin-bottom: 18px;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.login-field .form-label {
    display: block;
    margin-bottom: 8px;
    color: #173b3c;
    font-size: 14px;
    font-weight: 700;
}

.login-input-wrap {
    display: flex;
    align-items: center;
    min-height: 58px;
    border: 1px solid #d4e0e4;
    border-radius: 13px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 2px 5px rgba(10, 49, 54, .025);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.login-input-wrap:focus-within {
    border-color: #24b99a;
    box-shadow: 0 0 0 4px rgba(35, 185, 151, .12), 0 5px 15px rgba(13, 119, 94, .06);
    background: #fff;
}

.login-input-wrap.is-invalid { 
    border-color: #dc3545; 
}

.login-input-icon {
    flex: 0 0 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #527079;
    font-size: 21px;
}

.login-input-wrap .form-control {
    height: 56px;
    min-width: 0;
    padding: 0 10px 0 0;
    border: 0;
    border-radius: 13px;
    box-shadow: none !important;
    background: transparent;
    color: #143a3b;
    font-size: 15px;
}

.login-input-wrap .form-control::placeholder { 
    color: #96a4b3; 
    opacity: 1; 
}

.password-control { 
    padding-right: 0 !important; 
}

.password-toggle {
    flex: 0 0 52px;
    width: 52px;
    height: 54px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #4e6c77;
    font-size: 21px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.password-toggle:hover { 
    color: var(--login-green); 
}

.password-toggle:focus-visible { 
    outline: 2px solid #20a989; 
    outline-offset: -5px; 
}

.login-error {
    margin-top: 6px;
    color: #c52d3c;
    font-size: 12px;
    line-height: 1.45;
}

.login-options { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    margin: 4px 0 22px; 
}

.remember-option {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #29464c;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.remember-option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.custom-check {
    width: 19px;
    height: 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #a6b9bf;
    border-radius: 5px;
    background: #fff;
    color: #fff;
    transition: all .15s ease;
}

.custom-check i { 
    display: none; 
    font-size: 14px; 
    font-weight: 800; 
}

.remember-option input:checked + .custom-check { 
    background: var(--login-green); 
    border-color: var(--login-green); 
}

.remember-option input:checked + .custom-check i { 
    display: block; 
}

.remember-option input:focus-visible + .custom-check { 
    outline: 3px solid rgba(35,185,151,.25); 
    outline-offset: 2px; 
}

.login-submit {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    padding: 13px 18px;
    border: 1px solid #04745c;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(110deg, #087e63 0%, #00634f 60%, #034d40 100%);
    box-shadow: 0 9px 18px rgba(2, 103, 80, .21), inset 0 1px 0 rgba(255,255,255,.14);
    font-size: 18px;
    font-weight: 700;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.login-submit > i:first-child { 
    font-size: 21px; 
}

.login-submit-arrow { 
    margin-left: auto; 
    opacity: .75; 
    font-size: 17px; 
}

.login-submit:hover { 
    color: #fff; 
    filter: brightness(1.06); 
    transform: translateY(-1px); 
    box-shadow: 0 13px 24px rgba(2,103,80,.25); 
}

.login-submit:active { 
    transform: translateY(0); 
}

.forgot-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin-top: 23px;
}

.forgot-row a {
    flex: 0 0 auto;
    color: #078669;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.forgot-row a:hover { 
    color: #045f4d; 
    text-decoration: underline; 
}

.forgot-divider { 
    height: 1px; 
    flex: 1 1 auto; 
    background: linear-gradient(90deg, transparent, #d9e4e2); 
}

.forgot-divider:last-child { 
    transform: rotate(180deg); 
}

.login-card-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 23px;
    padding-top: 15px;
    border-top: 1px solid #edf1ef;
    color: #879496;
    font-size: 11px;
}

.login-card-footer i { 
    color: #158568; 
}

.login-developer-footer {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 12px;
    z-index: 5;
    text-align: center;
    color: rgba(245, 241, 218, .82);
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: .2px;
}

.login-developer-footer a {
    color: #f0d58e;
    font-weight: 700;
    text-decoration: none;
    transition: color .2s ease;
}

.login-developer-footer a:hover,
.login-developer-footer a:focus-visible {
    color: #fff2bd;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ================= MOBILE RESPONSIVE ================= */
@media (max-width: 767.98px) {
    body.login-page {
        background-position: center center;
        background-size: cover;
        background-attachment: scroll;
    }
    .login-stage { 
        justify-content: center; 
        padding: 18px 12px 28px; 
    }
    .login-card {
        width: 100%;
        max-width: 460px;
        max-height: calc(100dvh - 36px);
        border-radius: 22px;
        padding: 27px 22px 20px;
    }
    .login-logo-wrap { 
        width: 72px; 
        height: 72px; 
        border-radius: 20px; 
        margin-bottom: 11px; 
    }
    .login-brand { 
        margin-bottom: 22px; 
    }
    .login-brand h1 { 
        font-size: clamp(21px, 6vw, 27px); 
    }
    .login-subtitle { 
        font-size: 12px; 
        gap: 8px; 
    }
    .login-subtitle span { 
        width: 22px; 
    }
    .login-input-wrap { 
        min-height: 53px; 
    }
    .login-input-icon { 
        flex-basis: 48px; 
        font-size: 19px; 
    }
    .login-input-wrap .form-control { 
        height: 51px; 
        font-size: 14px; 
    }
    .password-toggle { 
        flex-basis: 44px; 
        width: 44px; 
        height: 50px; 
        font-size: 19px; 
    }
    .login-submit { 
        min-height: 54px; 
        font-size: 17px; 
    }
    .login-card-footer { 
        font-size: 10px; 
        margin-top: 18px; 
    }
    .login-developer-footer { 
        bottom: 8px; 
        font-size: 11px; 
    }
}

@media (max-width: 360px) {
    .login-card { padding: 22px 16px 17px; }
    .login-field .form-label { font-size: 13px; }
    .login-input-icon { flex-basis: 40px; }
    .login-options { margin-bottom: 17px; }
    .forgot-row a { font-size: 12px; }
}

@media (max-height: 700px) and (min-width: 768px) {
    .login-stage { padding-top: 12px; padding-bottom: 24px; }
    .login-card { padding-top: 22px; padding-bottom: 18px; }
    .login-logo-wrap { width: 66px; height: 66px; margin-bottom: 8px; }
    .login-brand { margin-bottom: 16px; }
    .login-description { margin-top: 5px; }
    .login-input-wrap { min-height: 49px; }
    .login-input-wrap .form-control { height: 47px; }
    .login-submit { min-height: 51px; }
    .forgot-row { margin-top: 15px; }
    .login-card-footer { margin-top: 15px; padding-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { 
        transition: none !important; 
    }
}