:root {
    color-scheme: light;
    --navy: #041f46;
    --dark-blue: #052f65;
    --blue: #063f87;
    --light-blue: #eef6ff;
    --orange: #e85d0f;
    --gold: #f3aa00;
    --green: #087b3f;
    --red: #b91c1c;
    --border: #cbd5e1;
    --text: #0f172a;
    --muted: #64748b;
}

* {
    box-sizing: border-box;
    border-radius: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    min-height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    background: #edf3f9;
    color: var(--text);
    font-family: Inter, Arial, sans-serif;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}

.page-shell {
    display: grid;
    grid-template-rows: 38px minmax(0, 1fr);
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.government-header {
    position: relative;
    z-index: 30;
    border-bottom: 3px solid var(--gold);
    background: var(--navy);
    color: #ffffff;
}

.government-header-inner {
    display: flex;
    width: min(calc(100% - 32px), 1320px);
    height: 35px;
    margin-inline: auto;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    font-size: 12px;
}

.header-left {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.header-title {
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flag-mark {
    display: grid;
    grid-template-rows: repeat(3, 3px);
    width: 30px;
    flex: 0 0 auto;
}

.flag-orange {
    background: #ff9933;
}

.flag-white {
    background: #ffffff;
}

.flag-green {
    background: #138808;
}

.header-status {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    color: #dbeafe;
    font-weight: 600;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #4ade80;
}

.login-stage {
    position: relative;
    display: flex;
    min-height: 0;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: clamp(10px, 1.8vw, 22px);
    background:
        linear-gradient(
            rgba(6, 63, 135, 0.035) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(6, 63, 135, 0.035) 1px,
            transparent 1px
        ),
        linear-gradient(
            135deg,
            #f8fbff 0%,
            #eaf2fb 55%,
            #f8fafc 100%
        );
    background-size:
        34px 34px,
        34px 34px,
        auto;
}

.login-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(390px, 0.96fr);
    width: min(1120px, 100%);
    height: min(690px, 100%);
    min-height: 0;
    overflow: hidden;
    border: 1px solid #94a3b8;
    background: #ffffff;
    box-shadow: 0 22px 55px rgba(4, 31, 70, 0.18);
}

.portal-information {
    position: relative;
    display: flex;
    min-height: 0;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(28px, 3.5vw, 48px);
    border-right: 4px solid var(--gold);
    background:
        linear-gradient(
            145deg,
            var(--navy) 0%,
            var(--dark-blue) 48%,
            var(--blue) 100%
        );
    color: #ffffff;
}

.portal-pattern {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.045) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.045) 1px,
            transparent 1px
        );
    background-size: 32px 32px;
    pointer-events: none;
}

.portal-content,
.portal-footer-content {
    position: relative;
    z-index: 2;
}

.portal-brand {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    gap: 14px;
    padding: 10px 16px 10px 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    text-decoration: none;
    transition:
        background-color 150ms ease,
        border-color 150ms ease;
}

.portal-brand:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.13);
}

.portal-logo {
    display: flex;
    width: 68px;
    height: 68px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 4px;
}

.portal-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.portal-brand-text {
    min-width: 0;
}

.portal-brand-text strong {
    display: block;
    font-family: Manrope, Arial, sans-serif;
    font-size: 21px;
    font-weight: 800;
}

.portal-brand-text small {
    display: block;
    margin-top: 3px;
    color: #dbeafe;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.45;
}

.portal-heading {
    margin-top: clamp(34px, 6vh, 66px);
}

.official-label {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-left: 4px solid var(--gold);
    background: rgba(255, 255, 255, 0.1);
    color: #dbeafe;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.portal-heading h1 {
    max-width: 560px;
    margin: 20px 0 0;
    font-family: Manrope, Arial, sans-serif;
    font-size: clamp(31px, 3.3vw, 46px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.portal-heading p {
    max-width: 535px;
    margin: 18px 0 0;
    color: #dbeafe;
    font-size: clamp(13px, 1.1vw, 15px);
    font-weight: 500;
    line-height: 1.75;
}

.portal-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.portal-feature {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 9px;
    padding: 14px 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.07);
}

.portal-feature svg {
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
    color: var(--gold);
}

.portal-feature strong {
    display: block;
    font-size: 11px;
    font-weight: 800;
}

.portal-feature span {
    display: block;
    margin-top: 3px;
    color: #bfdbfe;
    font-size: 8px;
    line-height: 1.4;
}

.access-warning {
    margin: 14px 0 0;
    color: #bfdbfe;
    font-size: 9px;
    line-height: 1.6;
}

.login-panel {
    display: flex;
    min-height: 0;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #ffffff;
    padding: clamp(24px, 3.8vw, 48px);
}

.login-panel-inner {
    width: min(100%, 420px);
}

.mobile-brand {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.mobile-brand > a {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
    color: inherit;
    text-decoration: none;
}

.mobile-brand img {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.mobile-brand strong {
    display: block;
    color: var(--dark-blue);
    font-family: Manrope, Arial, sans-serif;
    font-size: 18px;
    font-weight: 800;
}

.mobile-brand small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}

.mobile-status {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    border: 1px solid #86efac;
    background: #f0fdf4;
    color: var(--green);
    font-size: 9px;
    font-weight: 800;
}

.mobile-status span {
    width: 6px;
    height: 6px;
    background: #22c55e;
}

.login-heading {
    margin-bottom: clamp(20px, 3vh, 28px);
}

.restricted-label {
    display: inline-flex;
    padding: 7px 11px;
    border-left: 4px solid var(--orange);
    background: var(--light-blue);
    color: var(--blue);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.login-heading h2 {
    margin: 16px 0 0;
    color: var(--dark-blue);
    font-family: Manrope, Arial, sans-serif;
    font-size: clamp(30px, 3vw, 39px);
    font-weight: 800;
    letter-spacing: -0.035em;
}

.login-heading p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.alert-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
    padding: 11px 13px;
    border: 1px solid #fca5a5;
    border-left: 4px solid var(--red);
    background: #fef2f2;
    color: #991b1b;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
}

.alert-message svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.alert-message p {
    margin: 0;
}

.admin-login-form {
    position: relative;
}

.autofill-block {
    position: fixed;
    top: -1000px;
    left: -1000px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.form-group + .form-group {
    margin-top: clamp(14px, 2vh, 18px);
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #334155;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.015em;
}

.input-container {
    position: relative;
}

.input-container input {
    display: block;
    width: 100%;
    height: 50px;
    padding: 0 48px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--blue);
    outline: none;
    background: #ffffff;
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    transition:
        border-color 140ms ease,
        box-shadow 140ms ease,
        background-color 140ms ease;
}

.input-container input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.input-container input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(191, 219, 254, 0.75);
}

.input-container input.has-error {
    border-color: var(--red);
    background: #fffafa;
}

.input-container input.has-error:focus {
    box-shadow: 0 0 0 3px rgba(254, 202, 202, 0.75);
}

.input-icon {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 16px;
    display: flex;
    align-items: center;
    color: #64748b;
    pointer-events: none;
}

.input-icon svg {
    width: 18px;
    height: 18px;
}

.password-toggle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    width: 45px;
    align-items: center;
    justify-content: center;
    outline: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: #eff6ff;
    color: var(--blue);
}

.password-toggle svg {
    width: 19px;
    height: 19px;
}

.field-error {
    margin: 6px 0 0;
    color: var(--red);
    font-size: 10px;
    font-weight: 700;
}

.security-notice {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: clamp(15px, 2vh, 19px);
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-left: 4px solid var(--gold);
    background: #f8fafc;
}

.security-notice svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: var(--blue);
}

.security-notice p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.55;
}

.login-submit-button {
    display: inline-flex;
    width: 100%;
    height: 52px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: clamp(17px, 2.4vh, 22px);
    outline: none;
    background:
        linear-gradient(
            90deg,
            var(--dark-blue),
            var(--blue)
        );
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 9px 20px rgba(6, 63, 135, 0.2);
    transition:
        background-color 140ms ease,
        box-shadow 140ms ease;
}

.login-submit-button:hover {
    background: var(--navy);
    box-shadow: 0 11px 25px rgba(4, 31, 70, 0.27);
}

.login-submit-button:focus-visible {
    box-shadow:
        0 0 0 3px #bfdbfe,
        0 9px 20px rgba(6, 63, 135, 0.2);
}

.login-submit-button:disabled {
    opacity: 0.68;
    cursor: not-allowed;
}

.login-submit-button svg {
    width: 19px;
    height: 19px;
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: clamp(17px, 2.4vh, 23px);
    padding-top: clamp(13px, 2vh, 17px);
    border-top: 1px solid #cbd5e1;
}

.login-footer a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--blue);
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
}

.login-footer a:hover {
    color: var(--dark-blue);
    text-decoration: underline;
}

.login-footer a svg {
    width: 14px;
    height: 14px;
}

.login-footer p {
    margin: 0;
    color: #94a3b8;
    font-size: 9px;
    font-weight: 700;
}

.loading-spinner {
    animation: spin 700ms linear infinite;
}

.hidden {
    display: none !important;
}

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

@media (max-width: 900px) {
    .login-layout {
        display: block;
        width: min(500px, 100%);
        height: auto;
        max-height: 100%;
    }

    .portal-information {
        display: none;
    }

    .login-panel {
        padding: clamp(20px, 5vw, 34px);
    }

    .mobile-brand {
        display: flex;
    }
}

@media (max-width: 540px) {
    .government-header-inner {
        width: calc(100% - 20px);
    }

    .header-status {
        font-size: 0;
    }

    .header-status .status-dot {
        width: 8px;
        height: 8px;
    }

    .login-stage {
        padding: 8px;
    }

    .login-panel {
        padding: 20px;
    }

    .mobile-brand {
        margin-bottom: 18px;
    }

    .login-heading {
        margin-bottom: 18px;
    }

    .login-heading h2 {
        margin-top: 12px;
        font-size: 28px;
    }

    .input-container input {
        height: 48px;
    }

    .login-submit-button {
        height: 49px;
    }
}

@media (max-height: 740px) {
    .portal-information {
        padding-block: 25px;
    }

    .portal-heading {
        margin-top: 27px;
    }

    .portal-heading h1 {
        margin-top: 14px;
        font-size: 31px;
    }

    .portal-heading p {
        margin-top: 11px;
        font-size: 12px;
        line-height: 1.55;
    }

    .login-panel {
        padding-block: 20px;
    }

    .login-heading {
        margin-bottom: 15px;
    }

    .login-heading h2 {
        margin-top: 10px;
        font-size: 29px;
    }

    .login-heading p {
        margin-top: 5px;
    }

    .form-group + .form-group {
        margin-top: 12px;
    }

    .security-notice {
        margin-top: 12px;
    }

    .login-submit-button {
        height: 48px;
        margin-top: 13px;
    }

    .login-footer {
        margin-top: 12px;
        padding-top: 11px;
    }
}

@media (max-height: 650px) and (min-width: 901px) {
    .portal-logo {
        width: 56px;
        height: 56px;
    }

    .portal-heading {
        margin-top: 17px;
    }

    .official-label {
        padding-block: 6px;
    }

    .portal-heading h1 {
        margin-top: 10px;
        font-size: 27px;
    }

    .portal-heading p {
        margin-top: 8px;
        font-size: 11px;
        line-height: 1.45;
    }

    .portal-feature {
        padding: 9px;
    }

    .portal-feature span,
    .access-warning {
        display: none;
    }

    .login-heading h2 {
        font-size: 27px;
    }

    .security-notice {
        display: none;
    }
}

@media (max-height: 650px) and (max-width: 900px) {
    .mobile-brand {
        margin-bottom: 9px;
    }

    .mobile-brand img {
        width: 44px;
        height: 44px;
    }

    .login-heading {
        margin-bottom: 11px;
    }

    .restricted-label,
    .security-notice {
        display: none;
    }

    .login-heading h2 {
        margin-top: 0;
        font-size: 25px;
    }

    .login-heading p {
        font-size: 11px;
    }

    .login-footer {
        margin-top: 9px;
        padding-top: 9px;
    }
}

@media (max-width: 360px) {
    .login-panel {
        padding: 15px;
    }

    .mobile-status {
        display: none;
    }

    .login-footer p {
        display: none;
    }
}

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