* {
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    --bg: #0b1120;
    --panel: #111827;
    --panel-soft: #1f2937;
    --card: #ffffff;
    --line: #dbe3ef;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success-bg: #dcfce7;
    --success-text: #166534;
    --error-bg: #fee2e2;
    --error-text: #991b1b;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background: #eef2ff;
    color: var(--text);
}

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

.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.34), transparent 0, transparent 34%),
        radial-gradient(circle at 88% 18%, rgba(99, 102, 241, 0.22), transparent 0, transparent 24%),
        radial-gradient(circle at 60% 78%, rgba(14, 165, 233, 0.16), transparent 0, transparent 22%),
        linear-gradient(135deg, #091226 0%, #0f1b35 38%, #172554 100%);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(520px, 1.15fr) minmax(380px, 440px);
    gap: 48px;
    align-items: center;
    padding: 48px;
}

.brand-panel,
.auth-card,
.metric-card,
.content-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(219, 227, 239, 0.9);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

.brand-panel {
    position: relative;
    overflow: hidden;
    min-height: 640px;
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
        linear-gradient(135deg, rgba(30, 41, 59, 0.82), rgba(15, 23, 42, 0.66));
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 35px 80px rgba(2, 6, 23, 0.34);
    color: #ffffff;
}

.brand-panel::before,
.brand-panel::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(4px);
}

.brand-panel::before {
    width: 320px;
    height: 320px;
    top: -120px;
    right: -90px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.34) 0%, rgba(59, 130, 246, 0) 70%);
}

.brand-panel::after {
    width: 260px;
    height: 260px;
    bottom: -100px;
    left: -80px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.20) 0%, rgba(14, 165, 233, 0) 70%);
}

.brand-panel h1,
.card-header h2,
.page-header h1,
.content-card h2 {
    margin: 0 0 12px;
}

.brand-panel p,
.card-header p,
.metric-card p,
.content-card p,
.page-header p,
.sidebar-copy {
    color: var(--muted);
    line-height: 1.65;
}

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

.hero-copy {
    max-width: 680px;
}

.hero-copy h1 {
    margin-bottom: 18px;
    font-size: clamp(44px, 6vw, 72px);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.hero-lead {
    margin: 0 0 16px;
    font-size: 20px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.92);
}

.hero-text {
    max-width: 620px;
    margin: 0;
    font-size: 16px;
    color: rgba(226, 232, 240, 0.84);
}

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

.hero-feature {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.hero-feature strong,
.hero-metric strong {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
}

.hero-feature span,
.hero-metric span {
    display: block;
    line-height: 1.55;
    color: rgba(226, 232, 240, 0.82);
    font-size: 14px;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.hero-metric {
    padding: 20px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-metric strong {
    font-size: 30px;
    line-height: 1;
}

.auth-card {
    position: relative;
    padding: 38px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.68);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
}

.card-header {
    margin-bottom: 28px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #dbeafe;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 14px;
}

.badge.muted {
    background: #e2e8f0;
    color: #334155;
}

.stack-form {
    display: grid;
    gap: 12px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.stack-form label {
    font-size: 14px;
    font-weight: bold;
    color: #334155;
}

.stack-form input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #dbe2ea;
    border-radius: 14px;
    padding: 15px 16px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.stack-form input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.primary-button,
.logout-button {
    border: 0;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.primary-button {
    margin-top: 10px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.24);
}

.primary-button:hover,
.logout-button:hover {
    background: var(--primary-dark);
    color: #ffffff;
}

.alert {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    font-size: 14px;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.login-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    font-size: 13px;
    color: #64748b;
}

.login-note-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.14);
}

.setup-status {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.6;
}

.setup-ready {
    background: #dbeafe;
    color: #1d4ed8;
}

.setup-error,
.setup-locked {
    background: #fff7ed;
    color: #9a3412;
}

.setup-actions {
    margin-top: 18px;
}

.secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-weight: bold;
    background: #ffffff;
}

.dashboard-page {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 100vh;
    background: #f8fafc;
}

.sidebar {
    background: linear-gradient(180deg, var(--bg) 0%, var(--panel) 100%);
    color: #ffffff;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
}

.sidebar h2 {
    margin: 0 0 10px;
}

.sidebar-nav {
    display: grid;
    gap: 10px;
}

.nav-link {
    display: block;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
    background: rgba(37, 99, 235, 0.30);
}

.logout-button {
    width: 100%;
    background: #ffffff;
    color: var(--text);
}

.main-content {
    padding: 36px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 14px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.metric-card,
.content-card {
    padding: 24px;
}

.metric-label {
    display: inline-block;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: bold;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.metric-card strong {
    display: block;
    margin-bottom: 10px;
    font-size: 24px;
}

.feature-list {
    margin: 16px 0 0;
    padding-left: 20px;
    color: var(--muted);
    line-height: 1.9;
}

@media (max-width: 1024px) {
    .auth-shell,
    .dashboard-page {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        min-height: auto;
    }

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

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

@media (max-width: 640px) {
    .auth-shell,
    .main-content,
    .sidebar {
        padding: 20px;
    }

    .brand-panel,
    .auth-card,
    .metric-card,
    .content-card {
        border-radius: 18px;
    }

    .brand-panel,
    .auth-card {
        padding: 26px;
    }

    .page-header {
        flex-direction: column;
    }

    .hero-copy h1 {
        font-size: 40px;
    }
}
