:root {
    color-scheme: dark;
    --bg: #04070c;
    --bg-elevated: rgba(9, 18, 29, 0.76);
    --bg-card: rgba(10, 22, 37, 0.78);
    --bg-card-strong: rgba(10, 22, 37, 0.9);
    --line: rgba(125, 217, 255, 0.14);
    --line-strong: rgba(125, 217, 255, 0.28);
    --text: #f5fbff;
    --text-soft: rgba(223, 236, 247, 0.7);
    --accent: #73d9ff;
    --accent-strong: #9ce7ff;
    --danger: #ffb0b0;
    --danger-bg: rgba(139, 33, 33, 0.18);
    --success: #b5ffe8;
    --shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
    --panel-radius: 28px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at 50% 25%, rgba(78, 166, 217, 0.18), transparent 30%),
        radial-gradient(circle at 15% 15%, rgba(58, 100, 170, 0.14), transparent 24%),
        radial-gradient(circle at 85% 18%, rgba(23, 75, 141, 0.12), transparent 18%),
        linear-gradient(180deg, #05080e 0%, #04070c 100%);
    color: var(--text);
    font-family: var(--font);
    overflow-x: hidden;
}

body {
    position: relative;
}

#network-canvas,
.page-glow,
.page-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

#network-canvas {
    z-index: 0;
}

.page-glow {
    z-index: 1;
    background:
        radial-gradient(circle at 50% 35%, rgba(111, 210, 255, 0.08), transparent 22%),
        radial-gradient(circle at 50% 80%, rgba(111, 210, 255, 0.05), transparent 30%);
}

.page-grid {
    z-index: 1;
    opacity: 0.15;
    background-image:
        linear-gradient(rgba(115, 217, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(115, 217, 255, 0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 95%);
}

.app-shell {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.panel {
    width: min(100%, 1160px);
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 440px);
    align-items: stretch;
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 220ms ease, box-shadow 220ms ease;
}

.panel--auth {
    width: min(100%, 520px);
    grid-template-columns: 1fr;
}

.hero-card,
.auth-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(12, 23, 38, 0.8), rgba(6, 12, 21, 0.84));
    border: 1px solid var(--line);
    border-radius: var(--panel-radius);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

.hero-card::before,
.auth-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(156, 231, 255, 0.08), transparent 32%, transparent 68%, rgba(156, 231, 255, 0.06));
    pointer-events: none;
}

.hero-card {
    padding: 36px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.auth-card {
    padding: 30px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(7, 14, 24, 0.55);
    color: var(--accent-strong);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.76rem;
}

.eyebrow__dot,
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 14px rgba(115, 217, 255, 0.65);
}

.hero-heading {
    margin: 0;
    font-size: clamp(2.75rem, 5vw, 4.5rem);
    line-height: 0.96;
    letter-spacing: -0.04em;
}

.hero-subtitle,
.auth-subtitle,
.auth-meta,
.metric__copy,
.field-help,
.back-link,
.banner,
.trust-copy {
    color: var(--text-soft);
}

.hero-subtitle,
.auth-subtitle {
    margin: 0;
    max-width: 58ch;
    font-size: 1rem;
    line-height: 1.7;
}

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

.metric {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(7, 16, 28, 0.55);
}

.metric__label,
.field-label,
.form-heading,
.brand-mark__name,
.status-pill,
.auth-meta,
.back-link,
.action-button,
.ghost-button {
    letter-spacing: 0.04em;
}

.metric__label,
.status-pill,
.auth-meta,
.back-link {
    text-transform: uppercase;
    font-size: 0.72rem;
}

.metric__value {
    margin-top: 12px;
    font-size: 1.2rem;
    font-weight: 600;
}

.metric__copy {
    margin-top: 8px;
    font-size: 0.92rem;
    line-height: 1.6;
}

.hero-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.action-button,
.ghost-button {
    appearance: none;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, background-color 220ms ease, opacity 220ms ease;
}

.action-button {
    position: relative;
    min-width: 180px;
    padding: 16px 22px;
    background: linear-gradient(135deg, rgba(112, 212, 255, 0.95), rgba(73, 148, 255, 0.92));
    color: #04121d;
    box-shadow: 0 20px 40px rgba(59, 148, 255, 0.22);
    transform-style: preserve-3d;
    will-change: transform;
}

.action-button:hover,
.action-button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 24px 50px rgba(59, 148, 255, 0.28);
}

.action-button:disabled {
    opacity: 0.7;
    cursor: wait;
}

.ghost-button {
    padding: 13px 18px;
    background: rgba(7, 16, 28, 0.46);
    color: var(--text);
    border: 1px solid var(--line);
}

.ghost-button:hover,
.ghost-button:focus-visible {
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

.trust-copy {
    font-size: 0.92rem;
}

.status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(7, 16, 28, 0.5);
    color: var(--text-soft);
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.brand-mark__icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(114, 217, 255, 0.28), rgba(55, 101, 180, 0.22));
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.brand-mark__name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.brand-mark__meta {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 0.88rem;
}

.form-heading {
    margin: 0 0 8px;
    font-size: 2rem;
}

.auth-subtitle {
    margin-bottom: 22px;
}

.banner {
    display: none;
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid transparent;
    font-size: 0.95rem;
    line-height: 1.5;
}

.banner.is-visible {
    display: block;
}

.banner--error {
    background: var(--danger-bg);
    border-color: rgba(255, 176, 176, 0.28);
    color: #ffd5d5;
}

.banner--info {
    background: rgba(29, 69, 102, 0.22);
    border-color: rgba(115, 217, 255, 0.22);
    color: #ccefff;
}

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

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

.field-label {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
}

.field-input {
    width: 100%;
    border: 1px solid rgba(134, 191, 219, 0.18);
    border-radius: 18px;
    background: rgba(4, 9, 16, 0.56);
    color: var(--text);
    padding: 16px 18px;
    font: inherit;
    outline: none;
    transition: border-color 220ms ease, box-shadow 220ms ease, background-color 220ms ease;
}

.field-input::placeholder {
    color: rgba(223, 236, 247, 0.35);
}

.field-input:focus {
    border-color: rgba(115, 217, 255, 0.5);
    box-shadow: 0 0 0 4px rgba(115, 217, 255, 0.1);
    background: rgba(6, 13, 23, 0.72);
}

.field-help {
    min-height: 1.2em;
    font-size: 0.85rem;
}

.field-help.has-error {
    color: var(--danger);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
}

.checkbox-row input {
    accent-color: var(--accent);
}

.auth-actions {
    display: grid;
    gap: 12px;
    margin-top: 6px;
}

.auth-meta {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    color: var(--text-soft);
    text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
    color: var(--text);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

    .panel--auth {
        width: min(100%, 100%);
    }

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

    .hero-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .app-shell {
        padding: 18px;
    }

    .hero-card,
    .auth-card {
        padding: 22px;
        border-radius: 22px;
    }

    .hero-heading {
        font-size: 2.35rem;
    }

    .form-heading {
        font-size: 1.6rem;
    }

    .action-button,
    .ghost-button {
        width: 100%;
    }
}

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