:root {
    --bg: #0b1220;
    --bg-elevated: #111a2e;
    --bg-card: rgba(17, 26, 46, 0.72);
    --border: rgba(148, 163, 184, 0.16);
    --text: #e8edf7;
    --text-muted: #94a3b8;
    --accent: #22c55e;
    --accent-soft: rgba(34, 197, 94, 0.14);
    --accent-glow: rgba(34, 197, 94, 0.35);
    --gold: #f59e0b;
    --danger: #f87171;
    --radius: 14px;
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
    --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
}

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

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

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

.page {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.page::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(34, 197, 94, 0.12), transparent 55%),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(245, 158, 11, 0.08), transparent 50%),
        linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
    pointer-events: none;
    z-index: 0;
}

.grid-overlay {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent);
    pointer-events: none;
    z-index: 0;
}

.shell {
    position: relative;
    z-index: 1;
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.5rem 0 3rem;
}

.shell-centered {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.topbar-minimal {
    margin-bottom: 0;
    position: absolute;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(1120px, calc(100% - 2rem));
}

.status-card {
    width: min(520px, 100%);
    margin: 0 auto;
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.status-card h1 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.6rem, 4vw, 2.25rem);
    letter-spacing: -0.02em;
}

.status-lead {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.6;
}

.footer-minimal {
    margin-top: auto;
    padding-top: 2rem;
    justify-content: center;
    border-top: none;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 3.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #16a34a);
    display: grid;
    place-items: center;
    box-shadow: 0 0 24px var(--accent-glow);
}

.brand-mark svg {
    width: 22px;
    height: 22px;
    fill: #052e16;
}

.brand-text strong {
    display: block;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.brand-text span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.btn:hover {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #16a34a);
    border-color: transparent;
    color: #052e16;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4ade80, var(--accent));
    color: #052e16;
}

.hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 3rem;
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
    }
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.hero h1 {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.hero h1 em {
    font-style: normal;
    color: var(--accent);
}

.hero-lead {
    margin: 0 0 1.5rem;
    max-width: 34rem;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.api-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    font-family: var(--mono);
    font-size: 0.88rem;
    color: #cbd5e1;
}

.api-chip code {
    color: var(--gold);
}

.hero-panel {
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    padding: 1.5rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.hero-panel h2 {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.metric {
    padding: 0.9rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.metric strong {
    display: block;
    font-size: 1.35rem;
    margin-bottom: 0.15rem;
}

.metric span {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}

@media (max-width: 900px) {
    .features {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .features {
        grid-template-columns: 1fr;
    }
}

.feature-card {
    padding: 1.15rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.feature-card h3 {
    margin: 0.65rem 0 0.35rem;
    font-size: 1rem;
}

.feature-card p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
}

.auth-block {
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    padding: 1.25rem 1.35rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.06), rgba(255, 255, 255, 0.02));
}

.auth-block h2 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
}

.auth-block p {
    margin: 0 0 1rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.auth-steps {
    display: grid;
    gap: 0.65rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-steps li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.step-num {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.footer {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* Login */
.login-wrap {
    min-height: calc(100vh - 3rem);
    display: grid;
    place-items: center;
}

.login-card {
    width: min(420px, 100%);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    padding: 2rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.login-card h1 {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
}

.login-card .subtitle {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.field {
    margin-bottom: 1rem;
}

.field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    color: #cbd5e1;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="email"] {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text);
    font: inherit;
}

.field input:focus {
    outline: none;
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0 1.25rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.error-box {
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger);
    font-size: 0.88rem;
}

.login-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.back-link {
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.back-link a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}
