:root {
    color-scheme: dark;
    --sb-bg: #050813;
    --sb-bg-2: #080d1d;
    --sb-surface: rgba(10, 16, 31, 0.76);
    --sb-surface-strong: rgba(13, 21, 39, 0.92);
    --sb-border: rgba(149, 169, 214, 0.17);
    --sb-border-strong: rgba(167, 120, 255, 0.36);
    --sb-text: #f8f8ff;
    --sb-muted: #a5acc4;
    --sb-soft: #737c98;
    --sb-primary: #8b3dff;
    --sb-primary-2: #a855f7;
    --sb-primary-3: #5b21e8;
    --sb-primary-soft: rgba(139, 61, 255, 0.18);
    --sb-success: #78f5cb;
    --sb-danger: #ff7d9d;
    --sb-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
    --sb-radius-xl: 24px;
    --sb-radius-lg: 18px;
    --sb-radius-md: 12px;
    --sb-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="light"] {
    color-scheme: light;
    --sb-bg: #f5f7ff;
    --sb-bg-2: #edf1ff;
    --sb-surface: rgba(255, 255, 255, 0.88);
    --sb-surface-strong: rgba(255, 255, 255, 0.96);
    --sb-border: rgba(50, 62, 98, 0.14);
    --sb-border-strong: rgba(139, 61, 255, 0.32);
    --sb-text: #121729;
    --sb-muted: #596173;
    --sb-soft: #7c8498;
    --sb-shadow: 0 28px 90px rgba(31, 34, 58, 0.16);
}

* { box-sizing: border-box; }

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

body.sb-login-page {
    min-height: 100vh;
    font-family: var(--sb-font);
    color: var(--sb-text);
    background:
        radial-gradient(circle at 36% 20%, rgba(111, 40, 255, 0.38), transparent 27rem),
        radial-gradient(circle at 12% 82%, rgba(91, 33, 232, 0.22), transparent 24rem),
        linear-gradient(135deg, var(--sb-bg), var(--sb-bg-2) 45%, #050711);
    overflow-x: hidden;
}

body.sb-login-page::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(153, 103, 255, 0.9) 0 1px, transparent 1.5px),
        linear-gradient(rgba(139, 61, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 61, 255, 0.03) 1px, transparent 1px);
    background-size: 190px 190px, 72px 72px, 72px 72px;
    background-position: 23px 17px, 0 0, 0 0;
    opacity: 0.28;
}

img { max-width: 100%; display: block; }
a { color: #b975ff; text-decoration: none; }
a:hover { color: #d7b4ff; }
button,
input,
select { font: inherit; }
button { cursor: pointer; }

.sb-login-shell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
    min-height: calc(100vh - 106px);
    padding: 48px 48px 26px;
    gap: 56px;
    isolation: isolate;
}

.sb-hero,
.sb-auth { position: relative; min-width: 0; }

.sb-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 58px;
}

.sb-brand {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    color: var(--sb-text);
}

.sb-brand__mark { width: 78px; height: 78px; filter: drop-shadow(0 0 20px rgba(139, 61, 255, 0.35)); }
.sb-brand__text { display: grid; gap: 6px; text-transform: uppercase; letter-spacing: 0.13em; }
.sb-brand__text strong { font-size: 1.65rem; font-weight: 700; line-height: 1; }
.sb-brand__text small { color: #b36cff; font-size: 0.86rem; font-weight: 700; }

.sb-hero {
    isolation: isolate;
}

.sb-hero__visual {
    position: absolute;
    width: clamp(560px, 47vw, 820px);
    top: clamp(54px, 8.5vh, 92px);
    right: clamp(-150px, -8vw, -48px);
    opacity: 0.82;
    z-index: 0;
    pointer-events: none;
    filter: drop-shadow(0 0 46px rgba(129, 72, 255, 0.48));
}

.sb-hero__visual::after {
    content: "";
    position: absolute;
    inset: -12% -18% -16% -18%;
    background: radial-gradient(circle at 58% 42%, rgba(139, 61, 255, 0.22), transparent 58%);
    filter: blur(18px);
    z-index: -1;
}

.sb-hero__visual img {
    width: 100%;
    height: auto;
    object-fit: contain;
    opacity: 0.94;
    mix-blend-mode: screen;
    -webkit-mask-image: radial-gradient(ellipse at 62% 48%, #000 0%, #000 46%, rgba(0, 0, 0, 0.82) 58%, transparent 82%);
    mask-image: radial-gradient(ellipse at 62% 48%, #000 0%, #000 46%, rgba(0, 0, 0, 0.82) 58%, transparent 82%);
}

.sb-topbar--hero,
.sb-hero__content {
    position: relative;
    z-index: 1;
}

.sb-hero__content {
    width: min(760px, 100%);
    padding-top: clamp(68px, 12vh, 132px);
}

.sb-eyebrow {
    margin: 0 0 16px;
    color: #b36cff;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.72rem;
    font-weight: 800;
}

.sb-hero h1 {
    margin: 0;
    max-width: 530px;
    font-size: clamp(2.25rem, 4vw, 3.75rem);
    line-height: 1.17;
    letter-spacing: -0.055em;
    font-weight: 820;
}

.sb-hero h1 span {
    display: inline-block;
    color: #a855f7;
    text-shadow: 0 0 28px rgba(168, 85, 247, 0.38);
}

.sb-hero__lead {
    max-width: 450px;
    margin: 26px 0 44px;
    color: var(--sb-muted);
    font-size: 1.1rem;
    line-height: 1.55;
}

.sb-benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    max-width: 780px;
}

.sb-benefit-card {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 18px;
    min-height: 150px;
    padding-right: 20px;
    border-right: 1px solid var(--sb-border);
}

.sb-benefit-card:last-child { border-right: 0; }

.sb-benefit-card__icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(168, 85, 247, 0.36);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(139, 61, 255, 0.28), rgba(139, 61, 255, 0.09));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 12px 34px rgba(68, 25, 144, 0.22);
}

.sb-benefit-card__icon img { width: 30px; height: 30px; }
.sb-benefit-card h2 { margin: 0 0 10px; font-size: 1.02rem; line-height: 1.34; }
.sb-benefit-card p { margin: 0; color: var(--sb-muted); line-height: 1.48; }

.sb-trust-strip { margin-top: 36px; color: var(--sb-muted); }
.sb-trust-strip p { margin: 0 0 18px; font-size: 1rem; }
.sb-trust-strip div { display: flex; align-items: center; gap: clamp(24px, 4vw, 68px); flex-wrap: wrap; }
.sb-trust-strip span { color: rgba(233, 234, 255, 0.52); font-size: 1.4rem; font-weight: 780; letter-spacing: -0.03em; }
html[data-theme="light"] .sb-trust-strip span { color: rgba(18, 23, 41, 0.48); }
.sb-trust-strip small { display: block; font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.18em; font-weight: 700; }

.sb-topbar--auth {
    justify-content: flex-end;
    margin-bottom: 36px;
}

.sb-theme-toggle,
.sb-language-select {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--sb-border);
    background: rgba(9, 13, 27, 0.62);
    backdrop-filter: blur(18px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
html[data-theme="light"] .sb-theme-toggle,
html[data-theme="light"] .sb-language-select { background: rgba(255, 255, 255, 0.76); }

.sb-theme-toggle {
    gap: 4px;
    padding: 5px;
    border-radius: 999px;
}

.sb-icon-button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: transparent;
    opacity: 0.7;
}
.sb-icon-button img { width: 18px; height: 18px; }
.sb-icon-button--active {
    opacity: 1;
    background: linear-gradient(135deg, var(--sb-primary), var(--sb-primary-2));
    box-shadow: 0 6px 18px rgba(139, 61, 255, 0.38);
}

.sb-language-select {
    height: 42px;
    gap: 10px;
    padding: 0 12px 0 16px;
    border-radius: 999px;
    color: var(--sb-text);
}
.sb-language-select img { width: 18px; height: 18px; opacity: 0.86; }
.sb-language-select select {
    color: inherit;
    border: 0;
    outline: 0;
    background: transparent;
    min-width: 150px;
    appearance: auto;
}

.sb-login-card {
    width: min(690px, 100%);
    margin-left: auto;
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius-xl);
    padding: clamp(30px, 4.8vw, 58px) clamp(26px, 4.8vw, 62px) 36px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 36%),
        var(--sb-surface);
    box-shadow: var(--sb-shadow), inset 0 1px 0 rgba(255,255,255,0.04);
    backdrop-filter: blur(26px);
}

.sb-login-card__header { text-align: center; margin-bottom: 24px; }
.sb-login-card__mobile-mark { display: none; width: 54px; height: 54px; margin: 0 auto 14px; }
.sb-login-card h2 { margin: 0; font-size: clamp(1.52rem, 2vw, 1.85rem); letter-spacing: -0.025em; }
.sb-login-card__header p { margin: 8px 0 0; color: var(--sb-muted); }

.sb-alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 125, 157, 0.35);
    color: #ffd4de;
    background: rgba(255, 125, 157, 0.1);
    font-size: 0.92rem;
}
html[data-theme="light"] .sb-alert { color: #7f1230; }

.sb-login-form { display: grid; gap: 22px; }
.sb-field { display: grid; gap: 9px; }
.sb-field label,
.sb-field__row { color: var(--sb-text); font-size: 0.94rem; font-weight: 650; }
.sb-field__row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.sb-field__row a { font-size: 0.9rem; font-weight: 650; }

.sb-input-shell {
    height: 52px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 0 16px;
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius-md);
    background: rgba(5, 9, 18, 0.52);
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
html[data-theme="light"] .sb-input-shell { background: rgba(255,255,255,0.72); }
.sb-input-shell:focus-within {
    border-color: var(--sb-border-strong);
    box-shadow: 0 0 0 4px rgba(139, 61, 255, 0.14), 0 14px 32px rgba(26, 9, 63, 0.16);
    background: rgba(8, 13, 26, 0.76);
}
html[data-theme="light"] .sb-input-shell:focus-within { background: #fff; }
.sb-input-shell > img { width: 22px; height: 22px; opacity: 0.82; }
.sb-input-shell input {
    flex: 1;
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--sb-text);
    background: transparent;
}
.sb-input-shell input::placeholder { color: var(--sb-soft); }

.sb-password-toggle {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    opacity: 0.75;
}
.sb-password-toggle:hover { background: rgba(139, 61, 255, 0.12); opacity: 1; }
.sb-password-toggle img { width: 20px; height: 20px; }

.sb-field-error { min-height: 16px; color: var(--sb-danger); font-size: 0.78rem; }

.sb-checkline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    color: var(--sb-muted);
    user-select: none;
}
.sb-checkline input {
    width: 20px;
    height: 20px;
    accent-color: var(--sb-primary);
}

.sb-primary-button {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    border: 0;
    border-radius: 10px;
    color: white;
    background: linear-gradient(135deg, #8b3dff 0%, #6d28d9 54%, #7c3aed 100%);
    box-shadow: 0 18px 48px rgba(112, 45, 237, 0.35), inset 0 1px 0 rgba(255,255,255,0.18);
    font-size: 1rem;
    font-weight: 760;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}
.sb-primary-button:hover { transform: translateY(-1px); filter: brightness(1.05); }
.sb-primary-button:active { transform: translateY(0); }
.sb-primary-button[disabled] { cursor: wait; opacity: 0.72; }

.sb-button-loader {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,0.42);
    border-top-color: white;
    display: none;
    animation: sb-spin 720ms linear infinite;
}
.sb-primary-button[aria-busy="true"] .sb-button-loader { display: inline-block; }
@keyframes sb-spin { to { transform: rotate(360deg); } }

.sb-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 28px;
    margin: 28px 0 24px;
    color: var(--sb-soft);
    font-size: 0.92rem;
}
.sb-divider::before,
.sb-divider::after { content: ""; height: 1px; background: var(--sb-border); }

.sb-sso-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}
.sb-sso-button {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--sb-text);
    border: 1px solid var(--sb-border);
    border-radius: 9px;
    background: rgba(7, 12, 24, 0.46);
    font-weight: 720;
    transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}
html[data-theme="light"] .sb-sso-button { background: rgba(255, 255, 255, 0.74); }
.sb-sso-button:hover {
    transform: translateY(-1px);
    border-color: var(--sb-border-strong);
    background: rgba(139, 61, 255, 0.1);
}
.sb-sso-button img { width: 24px; height: 24px; }

.sb-signup-hint {
    margin: 28px 0 0;
    text-align: center;
    color: var(--sb-muted);
    font-size: 0.95rem;
}
.sb-signup-hint a { font-weight: 760; }

.sb-login-footer {
    position: relative;
    min-height: 106px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 48px 28px;
    border-top: 1px solid var(--sb-border);
    background: rgba(3, 7, 18, 0.22);
}
html[data-theme="light"] .sb-login-footer { background: rgba(255,255,255,0.38); }

.sb-security-note {
    display: flex;
    align-items: center;
    gap: 16px;
}
.sb-security-note > span {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(139, 61, 255, 0.18);
    border: 1px solid rgba(139, 61, 255, 0.28);
}
.sb-security-note img { width: 24px; height: 24px; }
.sb-security-note p,
.sb-copyright { margin: 0; color: var(--sb-muted); line-height: 1.45; }
.sb-security-note strong { color: var(--sb-text); font-weight: 760; }
.sb-copyright { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; }
.sb-copyright img { width: 30px; height: 30px; }

@media (max-width: 1240px) {
    .sb-login-shell { grid-template-columns: 1fr; gap: 28px; }
    .sb-topbar--hero { display: none; }
    .sb-hero__content { padding-top: 10px; }
    .sb-hero__visual { width: min(640px, 76vw); top: 28px; right: -8%; opacity: 0.34; }
    .sb-login-card { margin: 0 auto; }
    .sb-login-card__mobile-mark { display: block; }
    .sb-auth { order: -1; }
}

@media (max-width: 860px) {
    .sb-login-shell { padding: 22px 18px 26px; }
    .sb-topbar--auth { margin-bottom: 20px; flex-wrap: wrap; }
    .sb-language-select select { min-width: 122px; }
    .sb-benefits { grid-template-columns: 1fr; }
    .sb-benefit-card { border-right: 0; padding-right: 0; min-height: auto; }
    .sb-sso-grid { grid-template-columns: 1fr; }
    .sb-login-footer { padding: 20px 18px; flex-direction: column; align-items: flex-start; }
    .sb-copyright { white-space: normal; }
}

@media (max-width: 560px) {
    .sb-login-card { padding: 26px 18px 28px; border-radius: 20px; }
    .sb-hero { display: none; }
    .sb-input-shell { height: 50px; }
    .sb-topbar--auth { justify-content: space-between; }
    .sb-theme-toggle { order: 2; }
    .sb-language-select { order: 1; }
}

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