:root {
    --canvas: #f4f3ef;
    --surface: #fbfaf7;
    --ink: #171918;
    --ink-soft: #676a65;
    --line: #d8d8d1;
    --line-strong: #bfc1ba;
    --accent: #155dba;
    --accent-deep: #082b66;
    --accent-light: #55b8ff;
    --brand-gradient: linear-gradient(135deg, #082b66 0%, #155dba 52%, #55b8ff 100%);
    --brand-gradient-hover: linear-gradient(135deg, #061f4b 0%, #104f9f 52%, #3aa8f5 100%);
    --danger: #a43d31;
    --danger-pale: #f7e9e5;
    --sidebar: #161817;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    min-width: 320px;
    background: var(--canvas);
}

button, input { font: inherit; }

.login-shell {
    display: grid;
    grid-template-columns: minmax(360px, .78fr) minmax(520px, 1.22fr);
    min-height: 100svh;
}

.brand-plane {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 100svh;
    padding: clamp(32px, 5vw, 68px);
    color: #f6f7f4;
    background: var(--sidebar);
}

.brand-plane::after {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 5px;
    height: 34%;
    background: var(--brand-gradient);
    content: "";
    transform-origin: bottom;
    animation: line-rise 650ms cubic-bezier(.22, 1, .36, 1) both;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
    opacity: 0;
    animation: reveal 480ms 80ms cubic-bezier(.22, 1, .36, 1) forwards;
}

.brand-mark {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: 11px;
    background: var(--brand-gradient);
    transform: rotate(-4deg);
}

.brand-mark i {
    display: block;
    border-radius: 2px;
    background: #fff;
}

.brand-mark i:last-child { margin-top: 9px; }

.brand-lockup strong,
.brand-lockup small { display: block; }

.brand-lockup strong {
    font-size: 17px;
    letter-spacing: .1em;
}

.brand-lockup small {
    margin-top: 3px;
    color: #9da19c;
    font-size: 10px;
}

.brand-context {
    max-width: 510px;
    margin: auto 0;
    padding: clamp(72px, 12vh, 150px) 0;
    opacity: 0;
    transform: translateY(16px);
    animation: reveal 560ms 160ms cubic-bezier(.22, 1, .36, 1) forwards;
}

.eyebrow {
    margin: 0 0 13px;
    color: #858a84;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.brand-context h1 {
    max-width: 490px;
    margin: 0;
    font-size: clamp(34px, 4vw, 60px);
    font-weight: 590;
    letter-spacing: -.055em;
    line-height: 1.02;
}

.brand-context > p:last-child {
    max-width: 400px;
    margin: 27px 0 0;
    color: #a7aba5;
    font-size: 12px;
    line-height: 1.7;
}

.privacy-note {
    display: grid;
    grid-template-columns: 9px minmax(0, 1fr);
    gap: 13px;
    align-items: start;
    max-width: 420px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    color: #8f938e;
    font-size: 10px;
    line-height: 1.55;
}

.privacy-note > span {
    width: 8px;
    height: 8px;
    margin-top: 3px;
    border-radius: 50%;
    background: var(--brand-gradient);
    box-shadow: 0 0 0 4px rgba(21, 93, 186, .16);
}

.privacy-note p { margin: 0; }

.privacy-note strong {
    display: block;
    margin-bottom: 3px;
    color: #d8dbd6;
    font-size: 11px;
}

.login-workspace {
    display: grid;
    place-items: center;
    min-height: 100svh;
    padding: clamp(34px, 6vw, 92px);
}

.login-panel {
    width: min(100%, 440px);
    opacity: 0;
    transform: translateY(14px);
    animation: reveal 520ms 230ms cubic-bezier(.22, 1, .36, 1) forwards;
}

.login-panel header {
    padding-bottom: 30px;
    border-bottom: 1px solid var(--line-strong);
}

.login-panel h2 {
    margin: 0;
    font-size: clamp(38px, 4vw, 54px);
    font-weight: 610;
    letter-spacing: -.055em;
    line-height: 1;
}

.panel-intro {
    margin: 17px 0 0;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.6;
}

.system-notice {
    display: grid;
    grid-template-columns: 25px 1fr;
    gap: 12px;
    margin-top: 24px;
    padding: 16px;
    color: #6f3029;
    background: var(--danger-pale);
}

.system-notice > span {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border: 1px solid rgba(164, 61, 49, .35);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
}

.system-notice p {
    margin: 0;
    font-size: 10px;
    line-height: 1.55;
}

.system-notice strong {
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
}

.login-form {
    display: grid;
    gap: 22px;
    margin-top: 32px;
}

.field {
    display: grid;
    gap: 9px;
}

.field > span:first-child {
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.field input {
    width: 100%;
    height: 48px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--line-strong);
    border-radius: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font-size: 15px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input:focus {
    border-color: var(--accent);
    box-shadow: 0 2px 0 -1px var(--accent);
}

.password-control { position: relative; }

.password-control input { padding-right: 60px; }

.password-control button {
    position: absolute;
    top: 50%;
    right: 0;
    padding: 7px 0 7px 10px;
    border: 0;
    color: var(--ink-soft);
    background: transparent;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-control button:hover,
.password-control button:focus-visible { color: var(--accent); }

.form-message {
    display: none;
    min-height: 18px;
    margin-top: -5px;
    color: var(--danger);
    font-size: 11px;
    line-height: 1.5;
}

.form-message:not(:empty) { display: block; }

.form-message.is-success { color: #0f805a; }

.submit-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 51px;
    margin-top: 2px;
    padding: 0 18px;
    border: 1px solid var(--accent-deep);
    border-radius: 9px;
    color: #fff;
    background: var(--brand-gradient);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.submit-button:hover:not(:disabled) {
    background: var(--brand-gradient-hover);
    transform: translateY(-1px);
}

.submit-button:focus-visible {
    outline: 3px solid rgba(36, 87, 255, .22);
    outline-offset: 3px;
}

.submit-button:disabled {
    border-color: #aeb0aa;
    background: #aeb0aa;
    cursor: not-allowed;
    opacity: .72;
}

.submit-button[aria-busy="true"] i { animation: working 720ms ease-in-out infinite alternate; }

.login-panel footer,
.noscript-note {
    margin-top: 31px;
    padding-top: 19px;
    border-top: 1px solid var(--line);
    color: #92958f;
    font-size: 9px;
    line-height: 1.5;
}

.noscript-note { color: var(--danger); }

@keyframes reveal {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes line-rise {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

@keyframes working {
    to { transform: translateX(5px); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 850px) {
    .login-shell { display: block; }

    .brand-plane {
        min-height: auto;
        padding: 26px 24px 29px;
    }

    .brand-plane::after {
        width: 29%;
        height: 4px;
    }

    .brand-context {
        margin: 54px 0 0;
        padding: 0;
    }

    .brand-context h1 {
        max-width: 570px;
        font-size: clamp(31px, 8vw, 48px);
    }

    .brand-context > p:last-child { margin-top: 18px; }

    .privacy-note { display: none; }

    .login-workspace {
        min-height: auto;
        padding: 48px 24px 60px;
    }
}

@media (max-width: 420px) {
    .brand-context > p:last-child { display: none; }
    .login-panel h2 { font-size: 39px; }
}
