:root {
    --bg: #eef2f6;
    --card: #ffffff;
    --text: #101828;
    --muted: #667085;
    --line: #d8dee7;
    --line-soft: #e8edf3;
    --navy: #0b1f33;
    --blue: #009fe3;
    --blue-dark: #007fb7;
    --danger: #d92d20;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-family: 'Inter', sans-serif;
    font-synthesis: none;
    color: var(--text);
    background:
        linear-gradient(rgba(11, 31, 51, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(11, 31, 51, .025) 1px, transparent 1px),
        var(--bg);
    background-size: 28px 28px;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}
.auth-card {
    width: min(1040px, 100%);
    min-height: 610px;
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    overflow: hidden;
    border: 1px solid #cfd6df;
    border-radius: 6px;
    background: var(--card);
}
.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 48px 46px 34px;
    overflow: hidden;
    color: #fff;
    background: var(--navy);
}
.auth-brand::before,
.auth-brand::after {
    content: '';
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
}
.auth-brand::before {
    width: 340px;
    height: 340px;
    right: -190px;
    top: -170px;
    border: 1px solid rgba(255, 255, 255, .09);
}
.auth-brand::after {
    width: 230px;
    height: 230px;
    left: -150px;
    bottom: -110px;
    border: 1px solid rgba(0, 159, 227, .2);
}
.brand-logo-link {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 13px;
    width: fit-content;
    color: #fff;
    text-decoration: none;
}
.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: 40px;
    height: 40px;
}
.brand-mark-box {
    display: block;
    width: 13px;
    height: 26px;
    border: 2px solid var(--blue);
    border-radius: 2px;
}
.brand-mark-line {
    display: block;
    width: 4px;
    height: 34px;
    border-radius: 2px;
    background: var(--blue);
}
.brand-name {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -.02em;
    white-space: nowrap;
}
.brand-name span { color: var(--blue); }
.brand-line {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 1px;
    margin: 31px 0 37px;
    background: rgba(255, 255, 255, .12);
}
.brand-copy { position: relative; z-index: 1; }
.brand-kicker,
.form-kicker {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .10em;
    text-transform: uppercase;
}
.brand-kicker { color: #6ed2ff; }
.brand-copy h2 {
    max-width: 360px;
    margin: 12px 0 14px;
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.025em;
}
.brand-copy p {
    max-width: 410px;
    margin: 0;
    color: #b8c7d9;
    font-size: 15px;
    line-height: 1.7;
}
.brand-features {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 11px;
    margin-top: 35px;
    color: #d5dfeb;
    font-size: 13px;
    font-weight: 600;
}
.brand-features span { display: flex; align-items: center; gap: 9px; }
.brand-features i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.brand-meta {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: 34px;
    color: #7f95aa;
    font-size: 12px;
    font-weight: 600;
}
.auth-form-area {
    display: grid;
    place-items: center;
    padding: 54px 70px;
    background: #fff;
}
.auth-panel { width: min(420px, 100%); }
.form-heading { margin-bottom: 31px; }
.form-kicker { margin-bottom: 9px; color: var(--blue-dark); }
.form-heading h1 {
    margin: 0;
    color: var(--text);
    font-size: 32px;
    font-weight: 800;
    line-height: 1.16;
    letter-spacing: -.02em;
}
.form-heading p {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}
.auth-flash-message { display: none; }
.field + .field { margin-top: 20px; }
.field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 7px;
}
.field-label {
    display: block;
    margin-bottom: 7px;
    color: #344054;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}
.field-head .field-label { margin-bottom: 0; }
.forgot-link,
.auth-back-link,
.auth-mode-link {
    color: var(--blue-dark);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.forgot-link:hover,
.auth-back-link:hover,
.auth-mode-link:hover { text-decoration: underline; }
.input-wrap {
    display: flex;
    align-items: stretch;
    min-height: 50px;
    border: 1px solid #cfd5dc;
    border-radius: 4px;
    background: #fff;
    transition: border-color .16s ease, background .16s ease;
}
.input-wrap:focus-within { border-color: var(--blue); background: #fbfdff; }
.input-wrap.is-invalid { border-color: #f04438; animation: fieldShake .28s ease; }
.input-wrap input {
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 0 14px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
}
.input-wrap input::placeholder { color: #98a2b3; font-weight: 400; opacity: 1; }
.password-wrap input { padding-right: 4px; }
.password-toggle {
    flex: 0 0 76px;
    border: 0;
    border-left: 1px solid var(--line-soft);
    background: #f8fafc;
    color: #475467;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.password-toggle:hover { color: var(--blue-dark); }
.field-error {
    display: block;
    margin-top: 6px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
}
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0 22px;
}
.remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #475467;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.remember input { width: 16px; height: 16px; accent-color: var(--blue-dark); }
.auth-button,
.auth-secondary-button {
    position: relative;
    width: 100%;
    min-height: 50px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.auth-button {
    border: 1px solid #008bc7;
    background: var(--blue);
    color: #fff;
}
.auth-button:hover { border-color: #0078ad; background: #008fcd; }
.auth-button:disabled { cursor: wait; opacity: .76; }
.auth-button-spaced { margin-top: 24px; }
.auth-secondary-button {
    border: 1px solid #d0d5dd;
    background: #fff;
    color: #344054;
}
.auth-secondary-button:hover { background: #f8fafc; }
.auth-button-loader {
    display: none;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.auth-button.is-loading .auth-button-text { display: none; }
.auth-button.is-loading .auth-button-loader { display: block; }
.auth-back-link {
    display: block;
    width: fit-content;
    margin: 18px auto 0;
}
.auth-mode-link {
    display: block;
    margin: 16px 0 22px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.auth-action-stack { display: grid; gap: 12px; }
[hidden] { display: none !important; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fieldShake {
    0%, 100% { transform: translateX(0); }
    30% { transform: translateX(-4px); }
    60% { transform: translateX(4px); }
}

@media (max-width: 860px) {
    .auth-page { padding: 18px; }
    .auth-card { grid-template-columns: 1fr; width: min(620px, 100%); }
    .auth-brand { min-height: auto; padding: 30px; }
    .brand-line { margin: 22px 0 24px; }
    .brand-copy h2 { max-width: none; font-size: 28px; }
    .brand-features { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
    .brand-meta { padding-top: 24px; }
    .auth-form-area { padding: 42px 34px 48px; }
}

@media (max-width: 560px) {
    .auth-page { padding: 0; place-items: stretch; }
    .auth-card { min-height: 100vh; border: 0; border-radius: 0; }
    .auth-brand { padding: 24px 22px; }
    .brand-name { font-size: 21px; }
    .brand-copy h2 { font-size: 24px; }
    .brand-copy p { font-size: 14px; }
    .brand-features { display: none; }
    .brand-meta { display: none; }
    .auth-form-area { padding: 36px 22px 44px; align-items: start; }
    .form-heading h1 { font-size: 28px; }
    .field-head { align-items: flex-start; }
}

.brand-logo-image {
    display: block;
    width: auto;
    max-width: 220px;
    height: 46px;
    object-fit: contain;
    object-position: left center;
}
