:root {
    --bg: #09111a;
    --bg-soft: #0f1d2a;
    --panel: rgba(9, 17, 26, 0.76);
    --panel-strong: #101b28;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-strong: rgba(255, 255, 255, 0.08);
    --line: rgba(255, 255, 255, 0.12);
    --text: #eff6ff;
    --muted: #9db0c3;
    --brand: #f59e0b;
    --brand-strong: #fbbf24;
    --accent: #38bdf8;
    --danger: #fb7185;
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
    --radius: 28px;
    --radius-sm: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.24), transparent 25%),
        radial-gradient(circle at 82% 18%, rgba(245, 158, 11, 0.22), transparent 24%),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.18), transparent 28%),
        linear-gradient(145deg, #071019, var(--bg-soft) 46%, #071019);
}

.page::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95), transparent 88%);
}

.shell,
.dashboard-shell {
    position: relative;
    z-index: 1;
    width: min(1220px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0;
}

.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px);
    gap: 28px;
    align-items: center;
}

.dashboard-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 22px;
    align-items: stretch;
}

.hero,
.login-card,
.sidebar,
.content {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.hero {
    padding: 42px;
    overflow: hidden;
    position: relative;
}

.hero::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    right: -120px;
    top: -80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.22), transparent 70%);
    pointer-events: none;
}

.login-card,
.sidebar,
.content {
    padding: 28px;
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brand-strong);
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.04;
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.8rem, 5vw, 5.3rem);
}

h2 {
    font-size: clamp(1.7rem, 2.4vw, 2.5rem);
}

.lead,
.lead-small,
.field span,
.message,
.markdown-body,
.doc-link,
.button {
    line-height: 1.6;
}

.lead {
    margin: 18px 0 0;
    max-width: 55ch;
    color: var(--muted);
    font-size: 1.08rem;
}

.lead-small {
    margin: 12px 0 0;
    color: var(--muted);
}

.hero-copy {
    position: relative;
    z-index: 1;
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 34px;
}

.info-card {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
}

.info-card p {
    margin: 0;
    color: var(--muted);
}

.info-card strong {
    font-size: 1.1rem;
}

.info-card-primary {
    background: linear-gradient(145deg, rgba(56, 189, 248, 0.12), rgba(255, 255, 255, 0.04));
}

.info-label {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #cdd9e5;
}

.credential-card {
    align-content: start;
}

.credential-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.credential-row:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.credential-row span {
    color: var(--muted);
}

.form {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    font-size: 0.95rem;
    color: var(--muted);
}

.field input {
    width: 100%;
    padding: 15px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    font: inherit;
    color: var(--text);
}

.field input::placeholder {
    color: rgba(157, 176, 195, 0.55);
}

.field input:focus {
    outline: 2px solid rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.42);
}

.button {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 14px 18px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, var(--brand), #f97316);
    color: #141b23;
    transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 16px 30px rgba(245, 158, 11, 0.24);
}

.button:hover,
.doc-link:hover {
    transform: translateY(-1px);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    box-shadow: none;
}

.message {
    min-height: 1.6em;
    margin: 0;
    color: var(--muted);
}

.message[data-state="error"] {
    color: var(--danger);
}

.message[data-state="success"] {
    color: var(--brand-strong);
}

.card-copy {
    margin: 12px 0 0;
    color: var(--muted);
}

.card-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.card-foot span,
.content-chip {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 0.85rem;
}

.sidebar {
    display: grid;
    gap: 22px;
    align-content: start;
}

.sidebar-head h1 {
    font-size: clamp(2rem, 3vw, 2.8rem);
}

.sidebar-note {
    padding: 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-note p {
    margin: 10px 0 0;
    color: var(--muted);
}

.doc-list {
    display: grid;
    gap: 16px;
    max-height: 48vh;
    overflow: auto;
    padding-right: 4px;
}

.doc-list::-webkit-scrollbar {
    width: 8px;
}

.doc-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.category-group {
    display: grid;
    gap: 10px;
}

.category-title {
    margin: 0;
    padding: 0 2px;
    color: var(--brand-strong);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.category-routes {
    display: grid;
    gap: 8px;
}

.doc-link {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.doc-link[data-active="true"] {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(56, 189, 248, 0.08));
    border-color: rgba(245, 158, 11, 0.28);
}

.content {
    min-height: 620px;
    display: grid;
    grid-template-rows: auto 1fr;
}

.content-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.markdown-body {
    padding-top: 24px;
    color: #d9e6f2;
    max-width: 78ch;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin-top: 1.4em;
    margin-bottom: 0.5em;
}

.markdown-body h1:first-child,
.markdown-body h2:first-child,
.markdown-body h3:first-child {
    margin-top: 0;
}

.markdown-body p,
.markdown-body ul,
.markdown-body pre {
    margin: 0 0 16px;
}

.markdown-body p,
.markdown-body li {
    color: #c4d3e2;
}

.markdown-body ul {
    padding-left: 20px;
}

.markdown-body code {
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.09);
    font-family: "Courier New", monospace;
    font-size: 0.95em;
    color: #fef3c7;
}

.markdown-body pre {
    overflow-x: auto;
    padding: 16px;
    border-radius: 18px;
    background: #06101a;
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.markdown-body pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}

.markdown-body a {
    color: #7dd3fc;
}

.login-card {
    position: relative;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 55%);
    pointer-events: none;
}

@media (max-width: 920px) {
    .shell,
    .dashboard-shell {
        grid-template-columns: 1fr;
        padding: 20px 0;
    }

    .hero {
        padding: 28px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .content-head {
        flex-direction: column;
    }

    .content {
        min-height: auto;
    }
}
