:root {
    color-scheme: dark;
    --login-bg: #020617;
    --login-card: rgba(255, 255, 255, .97);
    --login-text: #0f172a;
    --login-muted: #64748b;
    --login-border: #e2e8f0;
    --login-blue: #2563eb;
    --login-violet: #7c3aed;
    --login-cyan: #06b6d4;
}

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

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

body.login-page {
    margin: 0;
    background: var(--login-bg);
    color: var(--login-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

.login-page__backdrop {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 0 0, rgba(124, 58, 237, .36), transparent 34%),
        radial-gradient(circle at 86% 18%, rgba(6, 182, 212, .27), transparent 30%),
        linear-gradient(135deg, #0f172a 0%, #111827 46%, #020617 100%);
}

.login-page__backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .22;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(to bottom, #000, transparent 80%);
}

.login-page__orb {
    position: fixed;
    border-radius: 999px;
    filter: blur(70px);
    pointer-events: none;
}

.login-page__orb--cyan { width: 310px; height: 310px; left: -100px; top: 22%; background: rgba(34, 211, 238, .13); }
.login-page__orb--violet { width: 350px; height: 350px; right: -90px; bottom: 4%; background: rgba(139, 92, 246, .14); }

.login-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(440px, .95fr);
    min-height: 100vh;
}

.login-story {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(32px, 4vw, 56px) clamp(38px, 6vw, 88px);
    color: #fff;
}

.brand-lockup { display: flex; align-items: center; gap: 16px; }
.brand-lockup strong { display: block; font-size: 21px; letter-spacing: .045em; }
.brand-lockup span { display: block; margin-top: 3px; color: rgba(207, 250, 254, .78); font-size: 13px; }

.brand-mark {
    width: 58px;
    height: 58px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--login-violet), var(--login-blue) 55%, var(--login-cyan));
    box-shadow: 0 16px 35px rgba(37, 99, 235, .25), inset 0 1px 0 rgba(255,255,255,.2);
}

.brand-mark svg { width: 38px; height: 38px; }

.story-copy { width: min(100%, 650px); padding: 44px 0; }
.security-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 999px;
    background: rgba(255,255,255,.09);
    color: rgba(236, 254, 255, .92);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
    backdrop-filter: blur(16px);
    font-size: 13px;
}

.security-pill svg, .access-note svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.story-copy h1 { max-width: 640px; margin: 25px 0 0; font-size: clamp(36px, 4.2vw, 56px); line-height: 1.12; letter-spacing: -.035em; }
.story-copy > p { max-width: 570px; margin: 22px 0 0; color: rgba(226,232,240,.8); font-size: 16px; line-height: 1.75; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: min(100%, 550px); margin-top: 32px; }
.feature-card { padding: 16px; border: 1px solid rgba(255,255,255,.11); border-radius: 17px; background: rgba(255,255,255,.085); backdrop-filter: blur(12px); }
.feature-card strong { display: block; font-size: 22px; letter-spacing: -.02em; }
.feature-card span { display: block; margin-top: 5px; color: rgba(226,232,240,.73); font-size: 12px; }
.story-footer { margin: 0; color: rgba(203,213,225,.68); font-size: 13px; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px clamp(28px, 4vw, 64px); }
.login-card {
    width: min(100%, 445px);
    padding: 32px;
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 30px;
    background: var(--login-card);
    box-shadow: 0 28px 70px rgba(0,0,0,.33), inset 0 1px 0 #fff;
    backdrop-filter: blur(20px);
}

.login-card__header { margin-bottom: 27px; text-align: center; }
.desktop-card-mark { margin: 0 auto 20px; }
.login-card__header h2 { margin: 0; color: var(--login-text); font-size: 26px; line-height: 1.2; letter-spacing: -.025em; }
.login-card__header p { margin: 9px auto 0; color: var(--login-muted); font-size: 14px; line-height: 1.55; }
.mobile-brand { display: none; }

.form-alert { margin: -3px 0 20px; padding: 12px 14px; border: 1px solid; border-radius: 14px; font-size: 13px; line-height: 1.5; }
.form-alert--error { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.form-alert--success { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.form-group + .form-group { margin-top: 19px; }
.form-group label { display: block; margin-bottom: 8px; color: #334155; font-size: 13px; font-weight: 700; }
.label-row { display: flex; align-items: center; justify-content: space-between; }
.label-row label { margin-bottom: 8px; }
.password-toggle { margin: 0 1px 8px 0; padding: 0; border: 0; background: transparent; color: var(--login-blue); cursor: pointer; font-size: 12px; font-weight: 700; }
.password-toggle:hover { color: #1d4ed8; }
.password-toggle:focus-visible { outline: 3px solid rgba(59,130,246,.22); outline-offset: 4px; border-radius: 3px; }

.field-shell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 0 15px;
    border: 1px solid var(--login-border);
    border-radius: 15px;
    background: #f8fafc;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.field-shell:focus-within { border-color: #60a5fa; background: #fff; box-shadow: 0 0 0 4px rgba(59,130,246,.12); }
.field-shell svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: #94a3b8; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.field-shell input { width: 100%; min-width: 0; padding: 14px 0; border: 0; outline: 0; background: transparent; color: var(--login-text); font-size: 14px; font-weight: 550; }
.field-shell input::placeholder { color: #94a3b8; font-weight: 400; }

.submit-button {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 24px;
    padding: 12px 18px;
    border: 0;
    border-radius: 15px;
    background: linear-gradient(90deg, var(--login-violet), var(--login-blue) 52%, var(--login-cyan));
    box-shadow: 0 14px 26px rgba(37,99,235,.23);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    transition: filter .18s ease, transform .18s ease, box-shadow .18s ease;
}

.submit-button:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 17px 32px rgba(37,99,235,.28); }
.submit-button:focus-visible { outline: 4px solid rgba(59,130,246,.28); outline-offset: 3px; }
.submit-button:disabled { cursor: wait; filter: saturate(.7); opacity: .7; transform: none; }
.submit-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.submit-button__spinner { display: none; width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: login-spin .65s linear infinite; }
.submit-button.is-loading .submit-button__arrow { display: none; }
.submit-button.is-loading .submit-button__spinner { display: block; }

.access-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 25px; padding: 14px; border: 1px solid var(--login-border); border-radius: 15px; background: #f8fafc; color: var(--login-muted); font-size: 11.5px; line-height: 1.55; }
.access-note svg { width: 18px; height: 18px; flex: 0 0 auto; color: #64748b; }

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

@media (max-width: 980px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-story { display: none; }
    .login-panel { min-height: 100vh; padding: 32px 20px; }
    .mobile-brand { display: flex; flex-direction: column; align-items: center; margin-bottom: 25px; text-align: center; }
    .mobile-brand .brand-mark { margin-bottom: 13px; }
    .mobile-brand strong { color: var(--login-text); font-size: 22px; letter-spacing: .04em; }
    .mobile-brand span { margin-top: 4px; color: var(--login-muted); font-size: 12px; }
    .desktop-card-mark { display: none; }
    .login-card__header { margin-bottom: 25px; }
}

@media (max-width: 520px) {
    .login-panel { align-items: flex-start; padding: 18px 12px; }
    .login-card { margin: auto 0; padding: 26px 20px; border-radius: 25px; }
    .login-card__header h2 { font-size: 23px; }
}

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