:root {
    --brand: #3A57E8;
    --brand-dark: #2C42C4;
    --brand-soft: #EDF0FE;
    --info: #08B1BA;
    --info-soft: #E3F8F9;
    --success: #1DA57A;
    --success-soft: #E4F6EF;
    --danger: #E85347;
    --danger-soft: #FCE7E4;
    --ink: #1B2137;
    --muted: #8A93A6;
    --bg: #F4F6FB;
    --card: #FFFFFF;
    --border: #EBEEF5;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

.auth-shell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 38px 22px;
    overflow: hidden;
    isolation: isolate;
}

.auth-background {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: -2;
    overflow: hidden;
}

.auth-background-left {
    left: 0;
    width: 52%;
    color: #fff;
    background:
        radial-gradient(circle at 20% 78%, rgba(8, 177, 186, .40), transparent 29%),
        radial-gradient(circle at 84% 12%, rgba(255, 255, 255, .16), transparent 25%),
        linear-gradient(145deg, #243CB9 0%, var(--brand) 57%, #4A67F2 100%);
}

.auth-background-right {
    right: 0;
    width: 48%;
    background:
        radial-gradient(circle at 88% 12%, rgba(58, 87, 232, .12), transparent 25%),
        linear-gradient(145deg, #F7F9FF 0%, var(--brand-soft) 100%);
}

.auth-background-left::after,
.auth-background-right::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.auth-background-left::after {
    background: linear-gradient(90deg, transparent 74%, rgba(255, 255, 255, .09));
}

.auth-background-right::after {
    opacity: .35;
    background-image:
        radial-gradient(circle at center, rgba(58, 87, 232, .18) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: linear-gradient(to bottom left, #000, transparent 64%);
}

.auth-background-grid {
    position: absolute;
    inset: 0;
    opacity: .07;
    background-image:
        linear-gradient(rgba(255, 255, 255, .7) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .7) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom right, #000, transparent 72%);
}

.auth-background-orb,
.auth-background-ring {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.auth-background-orb-one {
    top: -120px;
    left: -110px;
    width: 330px;
    height: 330px;
    background: rgba(255, 255, 255, .07);
}

.auth-background-orb-two {
    right: 7%;
    bottom: 8%;
    width: 150px;
    height: 150px;
    border: 28px solid rgba(255, 255, 255, .07);
}

.auth-background-ring-one {
    top: 12%;
    right: -90px;
    width: 260px;
    height: 260px;
    border: 1px solid rgba(58, 87, 232, .14);
}

.auth-background-ring-two {
    right: 20%;
    bottom: -120px;
    width: 350px;
    height: 350px;
    border: 54px solid rgba(58, 87, 232, .05);
}

.auth-background-copy {
    position: absolute;
    left: clamp(36px, 5vw, 82px);
    bottom: clamp(38px, 7vh, 78px);
    width: min(430px, calc(100% - 90px));
    opacity: .92;
}

.auth-background-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .09);
    color: rgba(255, 255, 255, .90);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

.auth-background-copy h2 {
    margin: 18px 0 12px;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(25px, 2.5vw, 39px);
    font-weight: 700;
    line-height: 1.16;
    letter-spacing: -.035em;
}

.auth-background-copy p {
    max-width: 405px;
    margin: 0;
    color: rgba(255, 255, 255, .70);
    font-size: 13px;
    line-height: 1.7;
}

.auth-login-card {
    position: relative;
    width: min(100%, 520px);
    padding: 30px 48px 28px;
    border: 1px solid rgba(235, 238, 245, .92);
    border-radius: 18px;
    background: rgba(255, 255, 255, .98);
    box-shadow:
        0 30px 80px rgba(27, 33, 55, .18),
        0 8px 24px rgba(27, 33, 55, .08);
    backdrop-filter: blur(18px);
}

.auth-login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 92px;
    height: 4px;
    border-radius: 0 0 999px 999px;
    background: linear-gradient(90deg, var(--brand), var(--info));
    transform: translateX(-50%);
}

.auth-government-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-align: left;
}

.auth-government-logo-wrap {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 82px;
    padding: 5px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(27, 33, 55, .09);
}

.auth-government-logo {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.auth-government-name {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.auth-government-name > span {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.auth-government-name strong {
    margin-top: 3px;
    color: var(--brand);
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    line-height: 1.15;
    letter-spacing: .015em;
}

.auth-government-name small {
    margin-top: 3px;
    color: #5B6478;
    font-size: 10.5px;
    line-height: 1.35;
}

.auth-card-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 21px 0 20px;
}

.auth-card-divider::before,
.auth-card-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-card-divider span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand-soft);
    box-shadow: 0 0 0 3px rgba(58, 87, 232, .08);
}

.auth-form-header {
    margin-bottom: 23px;
    text-align: center;
}

.auth-form-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--brand);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.auth-form-header h1 {
    margin: 0;
    color: var(--ink);
    font-family: 'Poppins', sans-serif;
    font-size: 31px;
    font-weight: 700;
    letter-spacing: .08em;
}

.auth-form-header p {
    margin: 8px auto 0;
    max-width: 350px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.55;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 17px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.45;
}

.auth-alert > i {
    margin-top: 1px;
}

.auth-alert-success {
    color: #147658;
    background: var(--success-soft);
    border-color: rgba(29, 165, 122, .14);
}

.auth-alert-danger {
    color: #B43C34;
    background: var(--danger-soft);
    border-color: rgba(232, 83, 71, .14);
}

.auth-field {
    margin-bottom: 17px;
}

.auth-field label {
    display: block;
    margin-bottom: 7px;
    color: #3D4358;
    font-size: 12px;
    font-weight: 700;
}

.auth-input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #F8F9FC;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-input-group:focus-within {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.auth-input-group.has-error {
    border-color: var(--danger);
    background: #FFFDFD;
}

.auth-input-icon {
    display: inline-flex;
    flex: 0 0 48px;
    align-items: center;
    justify-content: center;
    color: #9AA1B4;
    font-size: 16px;
}

.auth-input-group:focus-within .auth-input-icon {
    color: var(--brand);
}

.auth-input-group input {
    width: 100%;
    height: 48px;
    padding: 0 48px 0 0;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font-size: 13px;
}

.auth-input-group input:first-of-type:last-child {
    padding-right: 20px;
}

.auth-input-group input::placeholder {
    color: #A6ADBC;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 37px;
    height: 37px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #8D95A8;
    background: transparent;
    transform: translateY(-50%);
    cursor: pointer;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
    color: var(--brand);
    background: var(--brand-soft);
    outline: none;
}

.auth-field-error {
    margin-top: 7px;
    color: var(--danger);
    font-size: 11.5px;
    font-weight: 600;
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 2px 2px 20px;
}

.auth-checkbox {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    color: #5B6478 !important;
    font-size: 11.5px !important;
    font-weight: 500 !important;
    cursor: pointer;
    user-select: none;
}

.auth-checkbox input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.auth-checkbox-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid #D6DAE5;
    border-radius: 5px;
    color: transparent;
    background: #fff;
    font-size: 12px;
    transition: .16s ease;
}

.auth-checkbox input:checked + .auth-checkbox-box {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.auth-checkbox input:focus-visible + .auth-checkbox-box {
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.auth-security-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 11.5px;
}

.auth-security-text i {
    color: var(--success);
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    padding: 11px 20px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), #526BF0);
    box-shadow: 0 12px 28px rgba(58, 87, 232, .23);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
    transition: transform .17s ease, box-shadow .17s ease, opacity .17s ease;
    cursor: pointer;
}

.auth-submit span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 15px 34px rgba(58, 87, 232, .29);
}

.auth-submit:active:not(:disabled) {
    transform: translateY(0);
}

.auth-submit:disabled {
    opacity: .7;
    cursor: wait;
}

.auth-spinner {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, .38);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin .75s linear infinite;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

.auth-help {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 18px;
    padding: 11px 13px;
    border-radius: 10px;
    color: #70798C;
    background: var(--brand-soft);
    font-size: 11px;
    line-height: 1.5;
}

.auth-help i {
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--brand);
}

.auth-copyright {
    margin-top: 20px;
    color: #A0A7B7;
    font-size: 10px;
    text-align: center;
}

@media (max-width: 1040px) {
    .auth-background-copy {
        display: none;
    }
}

@media (max-width: 720px) {
    .auth-shell {
        align-items: flex-start;
        padding: 24px 14px;
    }

    .auth-background-left {
        width: 100%;
        height: 41%;
        min-height: 280px;
        bottom: auto;
    }

    .auth-background-right {
        top: 41%;
        width: 100%;
        left: 0;
    }

    .auth-login-card {
        margin-top: 18px;
        padding: 27px 26px 25px;
        border-radius: 17px;
    }
}

@media (max-width: 480px) {
    .auth-shell {
        padding: 16px 10px;
    }

    .auth-login-card {
        margin-top: 0;
        padding: 24px 19px 22px;
        border-radius: 15px;
    }

    .auth-government-brand {
        gap: 11px;
    }

    .auth-government-logo-wrap {
        width: 62px;
        height: 70px;
    }

    .auth-government-name > span {
        font-size: 9px;
    }

    .auth-government-name strong {
        font-size: 19px;
    }

    .auth-government-name small {
        font-size: 9.5px;
    }

    .auth-form-header h1 {
        font-size: 27px;
    }

    .auth-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
