:root {
    --ink: #171b18;
    --paper: #f1f3ed;
    --panel: #ffffff;
    --panel-2: #f7f8f4;
    --line: #e1e4db;
    --line-strong: #cdd1c4;
    --muted: #6c7268;
    --muted-2: #999d90;
    --signal: #0e7c63;
    --signal-ink: #0a5643;
    --signal-tint: #e3f2ec;
    --amber: #b87411;
    --amber-ink: #7a4c0b;
    --amber-tint: #fbeedb;
    --red: #b23a2e;
    --red-ink: #7d281f;
    --red-tint: #fbe6e3;
    --blue: #2c6fa0;
    --blue-ink: #1d4e74;
    --blue-tint: #e6eff6;
    --violet: #6b4fa0;
    --violet-ink: #4e3878;
    --violet-tint: #efe9f6;
    --radius: 6px;
    --shadow: 0 1px 2px rgba(23, 27, 24, 0.06);
    --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
    --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --shell-bg: #0b0c10;
    --side-bg: #12141c;
    --side-panel: #191c26;
    --side-fg: #f3f4f7;
    --side-muted: rgba(243, 244, 247, 0.62);
    --side-muted-2: rgba(243, 244, 247, 0.38);
    --side-line: rgba(243, 244, 247, 0.1);
    --side-accent: #8a6cfc;
    --side-accent-2: #c24fde;
    --side-accent-tint: rgba(138, 108, 252, 0.16);
}

* {
    box-sizing: border-box;
}

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

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    color: inherit;
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

p {
    margin: 0;
}

::selection {
    background: var(--side-accent-tint);
}

:focus-visible {
    outline: 3px solid var(--side-accent);
    outline-offset: 2px;
}

.auth-sprite {
    display: none;
}

.icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.75;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 10px;
    left: 10px;
    transform: translateY(-160%);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--ink);
    font-weight: 600;
    padding: 10px 14px;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(23, 27, 24, 0.16);
}

.skip-link:focus {
    transform: translateY(0);
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(360px, 42%) minmax(0, 1fr);
}

.auth-rail {
    position: relative;
    isolation: isolate;
    display: flex;
    min-height: 100vh;
    overflow: hidden;
    flex-direction: column;
    background: var(--side-bg);
    color: var(--side-fg);
    padding: 34px clamp(30px, 5vw, 72px);
}

.auth-rail::before,
.auth-rail::after {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.auth-rail::before {
    width: 390px;
    height: 390px;
    top: -170px;
    right: -180px;
    background: radial-gradient(circle, var(--side-accent-tint) 0, rgba(138, 108, 252, 0) 70%);
}

.auth-rail::after {
    width: 260px;
    height: 260px;
    bottom: -150px;
    left: -80px;
    border: 1px solid var(--side-line);
}

.auth-brand,
.auth-mobile-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.auth-brand-mark {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--side-accent), var(--side-accent-2));
    color: #fff;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.auth-brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.auth-brand-name {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
}

.auth-brand-label {
    margin-top: 3px;
    color: var(--side-muted);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.auth-rail-copy {
    width: 100%;
    max-width: 520px;
    margin: auto 0;
    padding: 74px 0;
}

.auth-eyebrow {
    display: block;
    color: var(--muted-2);
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-eyebrow--rail {
    color: var(--side-muted);
}

.auth-rail-title {
    max-width: 500px;
    margin-top: 18px;
    font-family: var(--font-display);
    font-size: clamp(30px, 3.3vw, 48px);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.08;
}

.auth-rail-description {
    max-width: 500px;
    margin-top: 18px;
    color: var(--side-muted);
    font-size: 14px;
    line-height: 1.65;
}

.auth-feature-list {
    display: grid;
    margin: 36px 0 0;
    padding: 0;
    gap: 4px;
    list-style: none;
}

.auth-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    border-top: 1px solid var(--side-line);
    padding: 14px 0;
}

.auth-feature-icon {
    display: inline-flex;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--side-line);
    border-radius: 8px;
    background: var(--side-panel);
    color: var(--side-accent);
}

.auth-feature-list strong,
.auth-feature-list small {
    display: block;
}

.auth-feature-list strong {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
}

.auth-feature-list small {
    margin-top: 2px;
    color: var(--side-muted);
    font-size: 11.5px;
    line-height: 1.45;
}

.auth-rail-status {
    display: flex;
    min-height: 40px;
    align-items: center;
    gap: 9px;
    border: 1px solid var(--side-line);
    border-radius: var(--radius);
    background: var(--side-panel);
    color: var(--side-muted);
    font-family: var(--font-mono);
    font-size: 10.5px;
    padding: 9px 11px;
}

.status-led {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #3fcba2;
    box-shadow: 0 0 0 3px rgba(63, 203, 162, 0.14);
}

.auth-rail-domain {
    overflow: hidden;
    margin-left: auto;
    color: var(--side-muted-2);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-main {
    display: grid;
    min-width: 0;
    background-color: var(--paper);
    background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
    background-size: 22px 22px;
    place-items: center;
    padding: 36px;
}

.auth-main-inner {
    width: 100%;
    max-width: 500px;
}

.auth-mobile-brand {
    display: none;
}

.auth-panel {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow);
    padding: clamp(24px, 4vw, 42px);
}

.auth-panel-header {
    margin-bottom: 28px;
}

.auth-panel-header h1 {
    margin: 12px 0 8px;
    font-family: var(--font-display);
    font-size: clamp(26px, 3vw, 32px);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.15;
}

.auth-panel-header p {
    max-width: 400px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.auth-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-left-width: 3px;
    border-radius: 9px;
    background: var(--panel-2);
    color: var(--muted);
    font-size: 12.5px;
    padding: 12px 13px;
}

.auth-notice > .icon {
    margin-top: 1px;
}

.auth-notice strong {
    display: block;
    margin-bottom: 2px;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 12.5px;
    font-weight: 600;
}

.auth-notice p {
    line-height: 1.5;
}

.auth-notice ul {
    margin: 5px 0 0;
    padding-left: 18px;
}

.auth-notice a {
    text-underline-offset: 2px;
}

.auth-notice--error {
    border-color: var(--red-tint);
    border-left-color: var(--red);
    background: var(--red-tint);
    color: var(--red-ink);
}

.auth-notice--success {
    border-color: var(--signal-tint);
    border-left-color: var(--signal);
    background: var(--signal-tint);
    color: var(--signal-ink);
}

.auth-notice--warning {
    border-color: var(--amber-tint);
    border-left-color: var(--amber);
    background: var(--amber-tint);
    color: var(--amber-ink);
}

.auth-notice--info {
    border-color: var(--blue-tint);
    border-left-color: var(--blue);
    background: var(--blue-tint);
    color: var(--blue-ink);
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-panel .container {
    width: 100%;
}

.auth-panel form:not(.auth-form) {
    display: grid;
    gap: 18px;
}

.auth-panel .form-group,
.auth-panel .mb-3 {
    display: grid;
    gap: 7px;
    margin: 0;
}

.auth-panel .form-label,
.auth-panel form:not(.auth-form) label {
    font-size: 12.5px;
    font-weight: 500;
}

.auth-panel .form-control {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--ink);
    font-size: 16px;
    padding: 11px 12px;
}

.auth-panel .form-control:focus {
    border-color: var(--ink);
    background: var(--panel-2);
    box-shadow: 0 0 0 3px rgba(23, 27, 24, 0.08);
    outline: none;
}

.auth-panel .btn {
    display: inline-flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--panel);
    font-size: 13px;
    font-weight: 600;
    padding: 11px 16px;
}

.auth-panel .btn-primary {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--paper);
}

.auth-panel .mt-2 {
    margin-top: 8px;
}

.auth-field {
    display: grid;
    gap: 7px;
}

.auth-field-label {
    display: flex;
    min-height: 20px;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.auth-field-label label {
    font-size: 12.5px;
    font-weight: 500;
}

.auth-field-label span {
    color: var(--muted-2);
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.auth-field-label a {
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 500;
    text-underline-offset: 3px;
}

.auth-field-label a:hover {
    color: var(--ink);
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 13px;
    color: var(--muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.auth-input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--ink);
    font-size: 16px;
    padding: 11px 44px 11px 40px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-input:hover {
    border-color: var(--muted-2);
}

.auth-input:focus {
    border-color: var(--ink);
    background: var(--panel-2);
    box-shadow: 0 0 0 3px rgba(23, 27, 24, 0.08);
    outline: none;
}

.auth-input[aria-invalid="true"] {
    border-color: var(--red);
    background: var(--red-tint);
}

.auth-input::placeholder {
    color: var(--muted-2);
    opacity: 1;
}

.password-toggle {
    position: absolute;
    top: 2px;
    right: 2px;
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
}

.password-toggle:hover {
    background: var(--panel-2);
    color: var(--ink);
}

.auth-field-error {
    color: var(--red-ink);
    font-size: 11.5px;
}

.auth-submit {
    display: inline-flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 2px;
    border: 1px solid var(--ink);
    border-radius: var(--radius);
    background: var(--ink);
    color: var(--paper);
    font-size: 13px;
    font-weight: 600;
    padding: 11px 16px;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.auth-submit:hover {
    opacity: 0.88;
}

.auth-submit:active {
    transform: translateY(1px);
}

.auth-submit:disabled {
    cursor: wait;
    opacity: 0.72;
}

.auth-submit.is-loading .icon {
    animation: auth-spin 0.8s linear infinite;
}

.auth-submit-status {
    min-height: 18px;
    margin-top: -12px;
    color: var(--muted);
    font-size: 11.5px;
    text-align: center;
}

.auth-panel-footer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 26px;
    border-top: 1px solid var(--line);
    color: var(--muted-2);
    font-size: 10.5px;
    padding-top: 16px;
}

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

@media (hover: none) {
    .auth-submit:hover {
        opacity: 1;
    }
}

@media (max-width: 980px) {
    .auth-shell {
        grid-template-columns: minmax(300px, 37%) minmax(0, 1fr);
    }

    .auth-rail {
        padding-inline: 30px;
    }

    .auth-feature-list {
        display: none;
    }
}

@media (max-width: 760px) {
    .auth-shell {
        display: block;
        min-height: 100vh;
        background: var(--paper);
    }

    .auth-rail {
        min-height: auto;
        padding: 22px 20px 30px;
    }

    .auth-rail-copy,
    .auth-rail-status {
        display: none;
    }

    .auth-main {
        min-height: calc(100vh - 86px);
        align-items: start;
        padding: 0 16px 36px;
    }

    .auth-main-inner {
        max-width: 540px;
        margin-top: -16px;
    }

    .auth-mobile-brand {
        display: none;
    }

    .auth-panel {
        border-radius: 12px;
        padding: 26px 22px;
    }
}

@media (max-width: 390px) {
    .auth-main {
        padding-inline: 10px;
    }

    .auth-panel {
        padding-inline: 18px;
    }

    .auth-panel-header h1 {
        font-size: 25px;
    }
}

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