:root {
    --navy-950: #111b2b;
    --navy-900: #172235;
    --navy-800: #26364d;
    --slate-600: #64748b;
    --slate-500: #7b8798;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;
    --white: #ffffff;
    --primary: #405674;
    --primary-dark: #31445f;
    --danger: #b42318;
    --danger-bg: #fff4f2;
    --danger-border: #ffd5cf;
    --focus-ring: rgba(64, 86, 116, 0.18);
}

* {
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: hidden;
}

body {
    height: 100vh;
    height: 100dvh;
    margin: 0;
    color: var(--navy-950);
    background: var(--slate-50);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}

.login-page {
    height: 100vh;
    height: 100dvh;
    display: grid;
    place-items: center;
    padding: 0;
    background: var(--white);
}

.login-shell {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: minmax(320px, 42%) minmax(420px, 58%);
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: var(--white);
    box-shadow: none;
}

.brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(36px, 5vw, 76px);
    color: var(--white);
    background: #1b2739;
}

.brand-panel__content,
.brand-panel__footer {
    position: relative;
    z-index: 1;
}

.brand-mark {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    margin-bottom: clamp(36px, 9vh, 84px);
    border-radius: 12px;
}

.brand-mark--light {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.brand-mark img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 7px;
}

.brand-panel__eyebrow,
.login-header__eyebrow {
    margin: 0 0 12px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.brand-panel__eyebrow {
    color: rgba(255, 255, 255, 0.66);
}

.brand-panel h2 {
    max-width: 260px;
    margin: 0;
    font-size: clamp(1.45rem, 2vw, 1.9rem);
    line-height: 1.2;
    letter-spacing: -0.035em;
}

.brand-panel__description {
    max-width: 300px;
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.82rem;
    line-height: 1.65;
}

.brand-panel__footer {
    margin: 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.72rem;
}

.form-panel {
    min-width: 0;
    display: grid;
    place-items: center;
    padding: clamp(32px, 7vw, 96px);
    border-left: 1px solid var(--slate-200);
}

.login-card {
    width: min(100%, 360px);
}

.mobile-brand {
    display: none;
}

.login-header {
    margin-bottom: 28px;
}

.login-header__eyebrow {
    color: var(--primary);
}

.login-header h1 {
    margin: 0 0 9px;
    font-size: clamp(1.55rem, 2.5vw, 1.85rem);
    line-height: 1.15;
    letter-spacing: -0.04em;
}

.login-header > p:last-child {
    margin: 0;
    color: var(--slate-600);
    font-size: 0.84rem;
    line-height: 1.5;
}

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: -4px 0 20px;
    padding: 11px 13px;
    border: 1px solid var(--danger-border);
    border-radius: 8px;
    color: var(--danger);
    background: var(--danger-bg);
    font-size: 0.78rem;
    line-height: 1.45;
}

.login-alert > span:first-child {
    margin-top: 3px;
}

.login-form {
    display: grid;
    gap: 17px;
}

.form-field label {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--navy-800);
    font-size: 0.78rem;
    font-weight: 650;
}

.input-control {
    position: relative;
}

.input-control > span {
    position: absolute;
    top: 50%;
    left: 17px;
    z-index: 1;
    color: var(--slate-500);
    font-size: 0.92rem;
    transform: translateY(-50%);
    pointer-events: none;
}

.input-control input {
    width: 100%;
    height: 46px;
    padding: 0 48px 0 46px;
    border: 1px solid var(--slate-300);
    border-radius: 8px;
    outline: none;
    color: var(--navy-950);
    background: var(--white);
    font-size: 0.84rem;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.input-control input::placeholder {
    color: #9aa5b5;
}

.input-control input:hover {
    border-color: #a9b5c5;
}

.input-control input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.input-control input[aria-invalid="true"] {
    border-color: #d98980;
}

.input-control input[aria-invalid="true"]:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.1);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    outline: none;
    color: var(--slate-500);
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
    transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

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

.password-toggle:focus-visible {
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.login-button {
    width: 100%;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 5px;
    border-radius: 8px;
    outline: none;
    color: var(--white);
    background: var(--primary);
    box-shadow: none;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 160ms ease, box-shadow 160ms ease;
}

.login-button:hover {
    background: var(--primary-dark);
    box-shadow: none;
    transform: none;
}

.login-button:active {
    transform: translateY(0);
}

.login-button:focus-visible {
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.login-button:disabled {
    cursor: wait;
    opacity: 0.75;
}

@media (max-width: 850px) {
    .login-page {
        padding: 0;
    }

    .login-shell {
        width: 100%;
        height: 100%;
        grid-template-columns: 1fr;
    }

    .brand-panel {
        display: none;
    }

    .form-panel {
        padding: clamp(24px, 8vw, 48px);
        border-left: 0;
    }

    .mobile-brand {
        width: 54px;
        height: 54px;
        display: grid;
        place-items: center;
        margin-bottom: clamp(24px, 6vh, 40px);
        border-radius: 15px;
        background: var(--primary);
    }

    .mobile-brand img {
        width: 35px;
        height: 35px;
        border-radius: 6px;
    }
}

@media (max-width: 520px) {
    .login-page {
        padding: 0;
        background: var(--white);
    }

    .form-panel {
        padding: 28px 24px;
    }

    .mobile-brand {
        margin-bottom: clamp(20px, 5vh, 32px);
    }

    .login-header {
        margin-bottom: 24px;
    }
}

@media (max-height: 620px) {
    .brand-mark {
        margin-bottom: 28px;
    }

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

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

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

    .login-form {
        gap: 13px;
    }
}

@media (max-height: 520px) {
    .form-panel {
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .mobile-brand {
        display: none;
    }

    .login-header {
        margin-bottom: 14px;
    }

    .login-header__eyebrow {
        margin-bottom: 7px;
    }

    .input-control input,
    .login-button {
        height: 42px;
    }
}

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