:root {
    --bg-main: #140d0c;
    --bg-panel: rgba(32, 18, 16, 0.82);
    --bg-panel-strong: rgba(48, 24, 21, 0.9);
    --line-soft: rgba(255, 173, 125, 0.2);
    --line-strong: rgba(255, 113, 73, 0.45);
    --text-main: #f7e9da;
    --text-muted: #cfb6a1;
    --text-dim: #9d7c69;
    --accent: #ff7149;
    --accent-soft: #ffb17d;
    --accent-cold: #ffd8ab;
    --success: #73e2a7;
    --danger: #ff8f7d;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --font-title: "Bahnschrift", "Segoe UI", "Microsoft YaHei UI", sans-serif;
    --font-body: "Segoe UI", "Microsoft YaHei UI", sans-serif;
    --font-mono: "Consolas", "Cascadia Mono", monospace;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 128, 88, 0.18), transparent 32%),
        radial-gradient(circle at bottom right, rgba(255, 84, 52, 0.16), transparent 24%),
        linear-gradient(145deg, #0d0909 0%, #1a0f0e 45%, #110b0b 100%);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.92), transparent 90%);
    pointer-events: none;
}

a {
    color: inherit;
    text-decoration: none;
}

code,
pre,
input {
    font-family: var(--font-mono);
}

.scene-glow {
    position: fixed;
    width: 34rem;
    height: 34rem;
    border-radius: 999px;
    filter: blur(44px);
    opacity: 0.2;
    pointer-events: none;
    animation: floatGlow 16s ease-in-out infinite;
}

.glow-a {
    top: -8rem;
    left: -6rem;
    background: rgba(255, 112, 73, 0.48);
}

.glow-b {
    right: -10rem;
    top: 16rem;
    background: rgba(255, 182, 117, 0.34);
}

.glow-c {
    left: 20%;
    bottom: -14rem;
    background: rgba(255, 80, 80, 0.32);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2rem;
    backdrop-filter: blur(18px);
    background: rgba(12, 8, 8, 0.55);
    border-bottom: 1px solid rgba(255, 136, 88, 0.08);
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.brand {
    font-family: var(--font-title);
    font-size: 1rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    max-width: min(32rem, 44vw);
    min-height: 2.2rem;
    padding: 0.2rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 174, 125, 0.14);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-muted);
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topnav {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
}

.topnav a {
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.topnav a:hover {
    background: rgba(255, 127, 88, 0.12);
    color: var(--text-main);
}

.page-shell {
    width: min(1180px, calc(100vw - 2rem));
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.page-shell.is-auth {
    width: min(980px, calc(100vw - 2rem));
    padding-top: 3rem;
}

.login-shell {
    width: min(100%, 540px);
    padding: 2rem 1rem;
}

.login-card {
    position: relative;
    overflow: hidden;
    padding: 3rem 2rem;
    border: 1px solid rgba(255, 173, 125, 0.18);
    border-radius: 32px;
    background:
        radial-gradient(circle at top, rgba(255, 128, 88, 0.18), transparent 44%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
        rgba(23, 13, 12, 0.9);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
    text-align: center;
}

.login-card::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 24px;
    pointer-events: none;
}

.login-card h1 {
    margin: 0;
    font-family: var(--font-title);
    font-size: clamp(2rem, 6vw, 2.8rem);
    letter-spacing: 0.04em;
}

.login-btn {
    min-width: min(100%, 320px);
    min-height: 3.4rem;
    margin-top: 1.2rem;
    padding: 0 1.4rem;
    border: 1px solid rgba(255, 190, 155, 0.24);
    border-radius: 999px;
    background: linear-gradient(135deg, #fff4e9 0%, #ffb98f 20%, #ff7a55 55%, #ff5d45 100%);
    color: #1f0f0c;
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 16px 40px rgba(255, 102, 73, 0.28);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 50px rgba(255, 102, 73, 0.34);
}

.login-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
    box-shadow: none;
}

.login-status {
    margin-top: 1rem;
    color: var(--text-muted);
}

.login-status[data-tone="success"] {
    color: var(--success);
}

.login-status[data-tone="danger"] {
    color: var(--danger);
}

.card {
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, rgba(255, 146, 95, 0.06), transparent 30%),
        var(--bg-panel);
    box-shadow: var(--shadow);
}

.card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.03);
    pointer-events: none;
}

.card-hero {
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.hero h1,
.section-head h2 {
    margin: 0;
    font-family: var(--font-title);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.hero h1 {
    font-size: clamp(2rem, 3vw, 3.5rem);
}

.hero-copy,
.copy,
.subtle,
.list {
    color: var(--text-muted);
}

.eyebrow {
    margin: 0 0 0.5rem;
    color: var(--accent-soft);
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-size: 0.72rem;
}

.grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.auth-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 1.5rem;
}

.auth-stack {
    display: grid;
    gap: 1.5rem;
}

.section-head {
    margin-bottom: 1rem;
}

.section-head-compact {
    margin-bottom: 0.75rem;
}

.section-head-compact h3 {
    margin: 0;
    font-family: var(--font-title);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.tag-row,
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tag {
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 179, 130, 0.18);
    background: rgba(255, 149, 111, 0.08);
    color: var(--accent-cold);
    font-size: 0.9rem;
}

.board-list {
    display: grid;
    gap: 0.9rem;
    margin: 1.2rem 0;
}

.board-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 158, 109, 0.08);
}

.label {
    color: var(--text-dim);
}

.list {
    margin: 0;
    padding-left: 1.2rem;
}

.primary-btn,
.ghost-btn {
    min-height: 2.9rem;
    padding: 0 1rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    font: inherit;
}

.primary-btn {
    background: linear-gradient(135deg, #ff8359, #ff5f45);
    color: #180f0d;
    font-weight: 700;
}

.ghost-btn {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    border: 1px solid rgba(255, 179, 141, 0.12);
}

.primary-btn[disabled],
.ghost-btn[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

.primary-btn:hover,
.ghost-btn:hover {
    transform: translateY(-1px);
}

.input-group {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.input-group span {
    color: var(--text-dim);
    font-size: 0.92rem;
}

.input-group input {
    width: 100%;
    min-height: 3rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 178, 138, 0.18);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-main);
    outline: none;
}

.input-group input:focus {
    border-color: var(--line-strong);
    box-shadow: 0 0 0 4px rgba(255, 118, 85, 0.08);
}

.status-panel {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 176, 129, 0.12);
    background: rgba(255, 255, 255, 0.03);
}

.status-panel[data-tone="success"] {
    color: var(--success);
    border-color: rgba(115, 226, 167, 0.24);
    background: rgba(115, 226, 167, 0.08);
}

.status-panel[data-tone="danger"] {
    color: var(--danger);
    border-color: rgba(255, 143, 125, 0.22);
    background: rgba(255, 143, 125, 0.08);
}

.verification-shell {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.verification-shell .subtle {
    margin: 0;
}

.turnstile-slot {
    width: min(100%, 420px);
    min-height: 65px;
    align-self: start;
    background: transparent;
}

.route-chip {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 176, 129, 0.16);
    background: rgba(255, 255, 255, 0.03);
    color: var(--accent-cold);
    word-break: break-all;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.metric-card {
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 171, 122, 0.12);
    background: rgba(255, 255, 255, 0.028);
}

.metric-card .label {
    display: block;
    margin-bottom: 0.45rem;
}

.metric-card strong,
.metric-card code {
    color: var(--text-main);
}

.note-list {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--text-muted);
}

.data-block {
    min-height: 14rem;
    margin: 1rem 0 0;
    padding: 1rem;
    overflow: auto;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 180, 140, 0.1);
    background: rgba(7, 5, 5, 0.52);
    color: #ffd7b4;
}

.footer-bar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 169, 121, 0.08);
}

.is-hidden {
    display: none;
}

@keyframes floatGlow {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(2rem, -1rem, 0) scale(1.08);
    }
}

@media (max-width: 840px) {
    .topbar,
    .footer-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-shell {
        width: min(100vw - 1rem, 1180px);
        padding-top: 1rem;
    }

    .grid-two {
        grid-template-columns: 1fr;
    }

    .auth-grid,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .board-item {
        flex-direction: column;
    }

    .topnav {
        flex-wrap: wrap;
    }

    .brand-row {
        width: 100%;
        flex-wrap: wrap;
    }

    .user-chip {
        max-width: 100%;
    }

    .login-card {
        padding: 2.4rem 1.4rem;
        border-radius: 24px;
    }

    .login-card::after {
        inset: 8px;
        border-radius: 18px;
    }
}
