:root {
    color-scheme: light;
    --navy-950: #08233f;
    --navy-900: #0c3156;
    --navy-800: #123f6d;
    --navy-700: #194f85;
    --navy-100: #eaf2f9;
    --orange-600: #e94e1b;
    --orange-500: #f45b24;
    --ink-900: #172231;
    --ink-700: #3c4a5d;
    --ink-500: #6a7687;
    --line: #d9e2ec;
    --surface: #ffffff;
    --page: #eef3f8;
    --danger: #c9362b;
    --focus: rgba(25, 79, 133, 0.2);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    overflow-x: clip;
    background: var(--page);
    font-size: 16px;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow-x: clip;
    color: var(--ink-900);
    background:
        radial-gradient(circle at 10% 10%, rgba(244, 91, 36, 0.08), transparent 27rem),
        radial-gradient(circle at 92% 92%, rgba(25, 79, 133, 0.1), transparent 30rem),
        var(--page);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input {
    font: inherit;
}

button,
a,
input,
label {
    -webkit-tap-highlight-color: transparent;
}

.login-page {
    display: grid;
    place-items: center;
    padding: clamp(1rem, 4vw, 3rem);
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(20rem, 0.9fr) minmax(27rem, 1.1fr);
    width: min(100%, 69rem);
    min-height: min(44rem, calc(100dvh - 6rem));
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(12, 49, 86, 0.08);
    border-radius: 1.75rem;
    box-shadow: 0 1.75rem 5rem rgba(12, 49, 86, 0.16);
}

.brand-panel {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    overflow: hidden;
    padding: clamp(2.25rem, 4vw, 4rem);
    color: #ffffff;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.05), transparent 42%),
        linear-gradient(145deg, var(--navy-800), var(--navy-950));
}

.brand-panel::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 2.5rem 2.5rem;
    content: "";
    mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.brand-orb {
    position: absolute;
    z-index: -1;
    border-radius: 999px;
    filter: blur(0.25rem);
    pointer-events: none;
}

.brand-orb-one {
    top: -6rem;
    right: -7rem;
    width: 20rem;
    height: 20rem;
    background: rgba(244, 91, 36, 0.3);
}

.brand-orb-two {
    right: 25%;
    bottom: -11rem;
    width: 23rem;
    height: 23rem;
    background: rgba(64, 145, 216, 0.18);
}

.brand-content {
    position: relative;
    z-index: 1;
}

.brand-logo-wrap {
    display: grid;
    place-items: center;
    width: 9.5rem;
    height: 9.5rem;
    margin-bottom: clamp(2.5rem, 7vh, 5rem);
    padding: 0.8rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 1.5rem;
    box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, 0.2);
}

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

.brand-copy {
    max-width: 29rem;
}

.brand-kicker,
.form-eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 1rem;
    color: var(--orange-500);
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.brand-kicker {
    color: #ffb190;
}

.brand-copy h2 {
    max-width: 25rem;
    margin: 0;
    font-size: clamp(2rem, 3.3vw, 3rem);
    font-weight: 750;
    letter-spacing: -0.045em;
    line-height: 1.05;
}

.brand-copy p {
    max-width: 27rem;
    margin: 1.25rem 0 0;
    color: rgba(255, 255, 255, 0.74);
    font-size: 1rem;
    line-height: 1.75;
}

.brand-assurance {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    padding-top: 2rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.875rem;
    font-weight: 650;
}

.brand-assurance span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-assurance svg,
.status-message svg,
.caps-lock-hint svg,
.form-footer svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.form-panel {
    display: grid;
    place-items: center;
    min-width: 0;
    padding: clamp(2rem, 6vw, 5rem);
    background:
        linear-gradient(rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.98)),
        radial-gradient(circle at top right, var(--navy-100), transparent 55%);
}

.form-card {
    width: min(100%, 27rem);
    min-width: 0;
}

.form-card form,
.field-group,
.input-wrap {
    width: 100%;
    min-width: 0;
}

.mobile-brand {
    display: none;
}

.form-header {
    margin-bottom: 2rem;
}

.form-header h1 {
    margin: 0;
    color: var(--ink-900);
    font-size: clamp(2rem, 3.4vw, 2.75rem);
    font-weight: 750;
    letter-spacing: -0.045em;
    line-height: 1.08;
}

.form-header p {
    margin: 0.75rem 0 0;
    color: var(--ink-500);
    font-size: 1rem;
    line-height: 1.6;
}

.status-message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.875rem 1rem;
    color: var(--navy-800);
    background: var(--navy-100);
    border: 1px solid #c7dcec;
    border-radius: 0.875rem;
    font-size: 0.9375rem;
    line-height: 1.45;
}

.status-message svg {
    flex: 0 0 auto;
    margin-top: 0.1rem;
}

.validation-summary {
    margin-bottom: 1.25rem;
    padding: 0.875rem 1rem;
    color: #93271f;
    background: #fff1f0;
    border: 1px solid #f6c7c2;
    border-radius: 0.875rem;
    font-size: 0.9375rem;
    line-height: 1.45;
}

.validation-summary:empty,
.validation-summary.validation-summary-valid {
    display: none;
}

.validation-summary ul {
    margin: 0;
    padding-left: 1.25rem;
}

.field-group {
    margin-bottom: 1.25rem;
}

.field-group label,
.field-label-row label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--ink-700);
    font-size: 0.9rem;
    font-weight: 700;
}

.field-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.forgot-link {
    flex: 0 0 auto;
    color: var(--navy-700);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
}

.forgot-link:hover {
    color: var(--orange-600);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.input-wrap {
    position: relative;
}

.input-wrap input {
    display: block;
    width: 100%;
    min-height: 3.25rem;
    padding: 0.75rem 1rem 0.75rem 3rem;
    color: var(--ink-900);
    background: #fbfdff;
    border: 1px solid var(--line);
    border-radius: 0.875rem;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.password-wrap input {
    padding-right: 3.25rem;
}

.input-wrap input::placeholder {
    color: #909bac;
    opacity: 1;
}

.input-wrap input:hover {
    border-color: #aab9c9;
}

.input-wrap input:focus {
    background: #ffffff;
    border-color: var(--navy-700);
    box-shadow: 0 0 0 0.25rem var(--focus);
}

.input-wrap input.input-validation-error {
    border-color: var(--danger);
}

.input-wrap input.input-validation-error:focus {
    box-shadow: 0 0 0 0.25rem rgba(201, 54, 43, 0.14);
}

.field-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 1rem;
    width: 1.2rem;
    height: 1.2rem;
    color: #78879a;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
    transform: translateY(-50%);
    pointer-events: none;
}

.input-wrap:focus-within .field-icon {
    color: var(--navy-700);
}

.password-toggle {
    position: absolute;
    z-index: 2;
    top: 50%;
    right: 0.5rem;
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    color: #68768a;
    background: transparent;
    border: 0;
    border-radius: 0.7rem;
    outline: none;
    transform: translateY(-50%);
    transition: color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.password-toggle:hover {
    color: var(--navy-800);
    background: var(--navy-100);
}

.password-toggle:focus-visible {
    color: var(--navy-800);
    box-shadow: 0 0 0 0.2rem var(--focus);
}

.eye-icon {
    position: absolute;
    width: 1.3rem;
    height: 1.3rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    transition: opacity 140ms ease, transform 140ms ease;
}

.eye-closed,
.password-toggle[aria-pressed="true"] .eye-open {
    opacity: 0;
    transform: scale(0.75);
}

.password-toggle[aria-pressed="true"] .eye-closed {
    opacity: 1;
    transform: scale(1);
}

.field-error {
    display: block;
    min-height: 1rem;
    margin-top: 0.4rem;
    color: var(--danger);
    font-size: 0.8125rem;
    font-weight: 650;
    line-height: 1.35;
}

.field-error:empty {
    min-height: 0;
    margin-top: 0;
}

.caps-lock-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    color: #a04b14;
    font-size: 0.8125rem;
    font-weight: 700;
}

.caps-lock-hint[hidden] {
    display: none;
}

.caps-lock-hint svg {
    width: 0.95rem;
    height: 0.95rem;
}

.remember-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0 0 1.5rem;
    color: var(--ink-700);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.remember-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.custom-checkbox {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 1.2rem;
    height: 1.2rem;
    color: #ffffff;
    background: #ffffff;
    border: 1px solid #aebccb;
    border-radius: 0.35rem;
    transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.custom-checkbox svg {
    width: 0.85rem;
    height: 0.85rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.3;
    opacity: 0;
    transform: scale(0.65);
    transition: opacity 120ms ease, transform 120ms ease;
}

.remember-option input:checked + .custom-checkbox {
    background: var(--navy-700);
    border-color: var(--navy-700);
}

.remember-option input:checked + .custom-checkbox svg {
    opacity: 1;
    transform: scale(1);
}

.remember-option input:focus-visible + .custom-checkbox {
    box-shadow: 0 0 0 0.25rem var(--focus);
}

.login-button {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 3.25rem;
    overflow: hidden;
    color: #ffffff;
    background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
    border: 0;
    border-radius: 0.875rem;
    box-shadow: 0 0.75rem 1.5rem rgba(25, 79, 133, 0.22);
    font-weight: 750;
    outline: none;
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.login-button::before {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 25%, rgba(255, 255, 255, 0.15), transparent 75%);
    content: "";
    transform: translateX(-110%);
    transition: transform 450ms ease;
}

.login-button:hover {
    box-shadow: 0 1rem 1.8rem rgba(25, 79, 133, 0.28);
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.login-button:hover::before {
    transform: translateX(110%);
}

.login-button:active {
    box-shadow: 0 0.45rem 1rem rgba(25, 79, 133, 0.2);
    transform: translateY(1px);
}

.login-button:focus-visible {
    box-shadow: 0 0 0 0.25rem var(--focus), 0 0.75rem 1.5rem rgba(25, 79, 133, 0.22);
}

.login-button:disabled {
    cursor: wait;
    filter: saturate(0.75);
}

.button-loading {
    display: none;
    align-items: center;
    gap: 0.65rem;
}

.login-button.is-loading .button-label {
    display: none;
}

.login-button.is-loading .button-loading {
    display: inline-flex;
}

.button-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.38);
    border-top-color: #ffffff;
    border-radius: 999px;
    animation: spin 650ms linear infinite;
}

.form-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 2rem;
    color: var(--ink-500);
    font-size: 0.8125rem;
    line-height: 1.45;
    text-align: center;
}

.form-footer svg {
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
}

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

@media (max-width: 860px) {
    .login-page {
        padding: 1rem;
    }

    .login-shell {
        display: block;
        width: min(100%, 34rem);
        min-height: 0;
        border-radius: 1.4rem;
    }

    .brand-panel {
        display: none;
    }

    .form-panel {
        padding: clamp(1.5rem, 7vw, 3rem);
    }

    .mobile-brand {
        display: grid;
        place-items: center;
        width: 5rem;
        height: 5rem;
        margin-bottom: 1.5rem;
        padding: 0.4rem;
        overflow: hidden;
        background: #ffffff;
        border: 1px solid var(--line);
        border-radius: 1rem;
        box-shadow: 0 0.75rem 2rem rgba(12, 49, 86, 0.1);
    }

    .mobile-brand img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}

@media (max-width: 480px) {
    .login-page {
        display: block;
        padding: 0;
        background: #ffffff;
    }

    .login-shell {
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .form-panel {
        min-height: 100vh;
        min-height: 100dvh;
        padding: max(1.5rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
    }

    .form-header {
        margin-bottom: 1.65rem;
    }

    .form-header h1 {
        font-size: 2rem;
    }

    .field-label-row {
        gap: 0.75rem;
    }

    .field-label-row label,
    .forgot-link {
        min-width: 0;
    }

    .forgot-link {
        font-size: 0.8125rem;
    }

    .form-footer {
        align-items: flex-start;
    }
}

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