/**
 * Public website (CMS pages, login, register) — "3D viewport" direction.
 * Dark editor viewport with a perspective grid, signal-lime accent and X/Y/Z axis colors.
 * No external fonts or scripts.
 *
 * CMS BLOCKS (usable in page content from Admin → Website pages):
 *   .hero > .hero-copy (.eyebrow, .hero-title, .hero-lead, .hero-actions, .formats) + .hero-visual (.wire-cube, .axis)
 *   .page-hero (.eyebrow, h1, .hero-lead)          — header for inner pages
 *   .section > .section-head (.eyebrow, h2)          — generic section
 *   .grid-3 > .feature (.feature-index, h3, p)       — 3-column cards
 *   ol.steps > li.step (h3, p)                       — numbered steps
 *   .cta-band (div + .btn)                           — call to action band
 *   .prose                                           — long-form text (terms, articles)
 *   .btn .btn-primary | .btn-ghost | .btn-sm         — buttons
 */

:root {
    --bg: #0d0f12;
    --bg-2: #14171c;
    --panel: #171a20;
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .16);
    --text: #eceff3;
    --muted: #9aa3af;
    --brand: #c6ff3d;
    --brand-ink: #182200;
    --x: #ff4d5e;
    --y: #3ddc84;
    --z: #4d8dff;
    --radius: 14px;
    --sans: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0; min-height: 100vh; display: flex; flex-direction: column;
    background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
body::before {
    /* Viewport grid, fading towards the bottom */
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 85%);
}
main { flex: 1 0 auto; overflow-x: clip; } /* 3D-transformed cube faces must not widen the page */
html, body { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.1; letter-spacing: -.025em; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.15rem; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 28px; } }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--brand); color: var(--brand-ink); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .8rem 1.35rem;
    border-radius: 999px; font-weight: 600; font-size: .95rem; text-decoration: none; border: 1px solid transparent;
    cursor: pointer; transition: transform .15s ease, background .15s, border-color .15s, box-shadow .2s; font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); box-shadow: 0 10px 30px -12px rgba(198, 255, 61, .6); }
.btn-primary:hover { background: #d4ff66; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--text); }
.btn-sm { padding: .5rem .95rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: rgba(13, 15, 18, .72); border-bottom: 1px solid var(--line); }
.site-header-inner { display: flex; align-items: center; gap: 1.5rem; height: 68px; }
.site-logo { display: inline-flex; align-items: center; gap: .65rem; color: var(--text); font-weight: 700; text-decoration: none; letter-spacing: -.01em; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-size: .9rem; }
.site-nav { display: flex; align-items: center; justify-content: space-between; flex: 1; gap: 1rem; }
.site-nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.site-nav ul a { color: var(--muted); text-decoration: none; padding: .45rem .75rem; border-radius: 8px; font-size: .92rem; }
.site-nav ul a:hover, .site-nav ul a.is-active { color: var(--text); background: rgba(255, 255, 255, .05); }
.site-nav-actions { display: flex; gap: .5rem; }
.nav-toggle { display: none; }
.nav-toggle-label { display: none; }

@media (max-width: 860px) {
    .site-header-inner { justify-content: space-between; }
    .nav-toggle-label { display: block; width: 28px; height: 20px; position: relative; cursor: pointer; }
    .nav-toggle-label span, .nav-toggle-label span::before, .nav-toggle-label span::after {
        position: absolute; left: 0; width: 100%; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, top .2s;
    }
    .nav-toggle-label span { top: 9px; }
    .nav-toggle-label span::before { content: ""; top: -7px; }
    .nav-toggle-label span::after { content: ""; top: 7px; }
    .site-nav {
        position: absolute; left: 0; right: 0; top: 68px; flex-direction: column; align-items: stretch; padding: 1rem 16px 1.25rem;
        background: var(--bg); border-bottom: 1px solid var(--line); display: none;
    }
    .site-nav ul { flex-direction: column; }
    .site-nav-actions .btn { flex: 1; }
    .nav-toggle:checked ~ .site-nav { display: flex; }
    .nav-toggle:checked + .nav-toggle-label span { background: transparent; }
    .nav-toggle:checked + .nav-toggle-label span::before { top: 0; transform: rotate(45deg); }
    .nav-toggle:checked + .nav-toggle-label span::after { top: 0; transform: rotate(-45deg); }
}

/* ---------- CMS blocks ---------- */
.cms-content > section { margin-left: auto; margin-right: auto; max-width: 1180px; padding-left: 16px; padding-right: 16px; }
@media (min-width: 768px) { .cms-content > section { padding-left: 28px; padding-right: 28px; } }

.eyebrow {
    display: inline-flex; align-items: center; gap: .5rem; font-family: var(--mono); font-size: .75rem; text-transform: uppercase;
    letter-spacing: .14em; color: var(--brand); margin-bottom: 1rem;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; }
.accent { color: var(--brand); }

.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 2rem; align-items: center; min-height: calc(88vh - 68px); padding-top: 3rem; padding-bottom: 3rem; }
.hero-title { font-size: clamp(2.4rem, 6vw, 4.6rem); letter-spacing: -.04em; line-height: 1.02; }
.hero-lead { font-size: clamp(1rem, 1.6vw, 1.15rem); color: var(--muted); max-width: 38rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0; }
.formats { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0; }
.formats li { font-family: var(--mono); font-size: .72rem; padding: .3rem .6rem; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--muted); letter-spacing: .06em; }
.hero-copy > * { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.hero-copy > *:nth-child(2) { animation-delay: .08s; }
.hero-copy > *:nth-child(3) { animation-delay: .16s; }
.hero-copy > *:nth-child(4) { animation-delay: .24s; }
.hero-copy > *:nth-child(5) { animation-delay: .32s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* CSS-only wireframe cube */
.hero-visual { position: relative; aspect-ratio: 1; display: grid; place-items: center; perspective: 900px; }
.hero-visual::before {
    content: ""; position: absolute; inset: 8%; border-radius: 50%;
    background: radial-gradient(circle, rgba(198, 255, 61, .16), transparent 62%); filter: blur(10px);
}
.wire-cube { --s: clamp(150px, 22vw, 250px); position: relative; width: var(--s); height: var(--s); transform-style: preserve-3d; animation: turn 18s linear infinite; }
.wire-cube span {
    position: absolute; inset: 0; border: 1.5px solid rgba(198, 255, 61, .85);
    background: linear-gradient(135deg, rgba(198, 255, 61, .07), transparent 70%);
    box-shadow: inset 0 0 30px rgba(198, 255, 61, .08);
}
.wire-cube span::after {
    content: ""; position: absolute; inset: 0;
    background-image: linear-gradient(rgba(198, 255, 61, .18) 1px, transparent 1px), linear-gradient(90deg, rgba(198, 255, 61, .18) 1px, transparent 1px);
    background-size: 25% 25%;
}
.wire-cube span:nth-child(1) { transform: translateZ(calc(var(--s) / 2)); }
.wire-cube span:nth-child(2) { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.wire-cube span:nth-child(3) { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.wire-cube span:nth-child(4) { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.wire-cube span:nth-child(5) { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.wire-cube span:nth-child(6) { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
@keyframes turn { from { transform: rotateX(-24deg) rotateY(0); } to { transform: rotateX(-24deg) rotateY(360deg); } }
.axis { position: absolute; left: 6%; bottom: 6%; display: flex; gap: .6rem; font-family: var(--mono); font-size: .7rem; }
.axis i { font-style: normal; padding: .15rem .45rem; border-radius: 4px; border: 1px solid currentColor; }
.axis .x { color: var(--x); } .axis .y { color: var(--y); } .axis .z { color: var(--z); }
@media (prefers-reduced-motion: reduce) { .wire-cube, .hero-copy > * { animation: none; } }
@media (max-width: 860px) {
    .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 2rem; }
    .hero-title { font-size: clamp(2rem, 9vw, 2.6rem); }
    .hero-visual { max-width: 340px; width: 100%; margin: 0 auto; order: -1; }
}

.page-hero { padding-top: 4.5rem; padding-bottom: 1.5rem; max-width: 900px !important; margin-left: 0 !important; }
@media (min-width: 1180px) { .page-hero { margin-left: calc((100vw - 1180px) / 2) !important; } }

.section { padding-top: 3.5rem; padding-bottom: 3.5rem; }
.section-head { max-width: 640px; margin-bottom: 2rem; }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }
.feature {
    position: relative; padding: 1.6rem; border-radius: var(--radius); background: linear-gradient(180deg, var(--panel), var(--bg-2));
    border: 1px solid var(--line); transition: border-color .2s, transform .2s;
}
.feature:hover { border-color: rgba(198, 255, 61, .35); transform: translateY(-2px); }
.feature p { color: var(--muted); margin: 0; }
.feature-index { display: inline-block; font-family: var(--mono); font-size: .72rem; color: var(--brand); letter-spacing: .1em; margin-bottom: 2.2rem; }
.grid-3 .feature:nth-child(1) .feature-index { color: var(--x); }
.grid-3 .feature:nth-child(2) .feature-index { color: var(--y); }
.grid-3 .feature:nth-child(3) .feature-index { color: var(--z); }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 1rem; }
.step { counter-increment: step; position: relative; padding: 1.5rem 1.5rem 1.5rem 5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.step::before {
    content: "0" counter(step); position: absolute; left: 1.5rem; top: 1.45rem; font-family: var(--mono); font-size: 1.4rem; font-weight: 700; color: var(--brand);
}
.step p { color: var(--muted); margin: 0; }

.cta-band {
    display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
    margin-top: 2rem; margin-bottom: 4rem; padding: 2rem !important; border-radius: calc(var(--radius) + 4px);
    border: 1px solid rgba(198, 255, 61, .3);
    background: radial-gradient(120% 140% at 0% 0%, rgba(198, 255, 61, .14), transparent 55%), var(--panel);
}
@media (min-width: 768px) { .cta-band { padding: 2.25rem 2.5rem !important; } }
.cta-band h2 { margin-bottom: .25rem; font-size: clamp(1.3rem, 2.4vw, 1.75rem); }
.cta-band p { color: var(--muted); margin: 0; }
.cms-content > .cta-band { max-width: calc(1180px - 56px); }

.prose { max-width: 760px !important; margin-left: 0 !important; color: #d4d9e0; }
@media (min-width: 1180px) { .prose { margin-left: calc((100vw - 1180px) / 2) !important; } }
.prose h2 { font-size: 1.35rem; margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }

/* ---------- Auth pages ---------- */
.auth-wrap { display: grid; place-items: center; padding: 3rem 16px 4rem; }
.auth-card {
    width: 100%; max-width: 440px; padding: 2rem; border-radius: calc(var(--radius) + 4px); border: 1px solid var(--line-strong);
    background: linear-gradient(180deg, rgba(23, 26, 32, .92), rgba(20, 23, 28, .96)); box-shadow: 0 30px 80px -40px #000;
}
.auth-card.is-wide { max-width: 620px; }
.auth-card h1 { font-size: 1.7rem; margin-bottom: .35rem; }
.auth-card .lead { color: var(--muted); margin-bottom: 1.5rem; font-size: .95rem; }
.auth-foot { text-align: center; margin-top: 1.25rem; color: var(--muted); font-size: .9rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .35rem; color: #cfd5dd; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
.input {
    width: 100%; padding: .75rem .9rem; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(0, 0, 0, .25);
    color: var(--text); font: inherit; font-size: .95rem; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #6b7380; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(198, 255, 61, .18); }
.hint { font-size: .78rem; color: var(--muted); margin-top: .3rem; }
.alert { padding: .8rem 1rem; border-radius: 10px; font-size: .9rem; margin-bottom: 1rem; border: 1px solid; }
.alert-error { background: rgba(255, 77, 94, .1); border-color: rgba(255, 77, 94, .4); color: #ffb3bb; }
.alert-success { background: rgba(61, 220, 132, .1); border-color: rgba(61, 220, 132, .4); color: #aef0c9; }
.alert-info { background: rgba(77, 141, 255, .1); border-color: rgba(77, 141, 255, .4); color: #b9d0ff; }

.role-picker { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1.25rem; }
.role-option { position: relative; }
.role-option input { position: absolute; opacity: 0; }
.role-option label {
    display: block; height: 100%; padding: 1rem; border-radius: 12px; border: 1px solid var(--line-strong); cursor: pointer;
    background: rgba(0, 0, 0, .2); transition: border-color .15s, background .15s;
}
.role-option label strong { display: flex; align-items: center; gap: .5rem; font-size: .95rem; }
.role-option label span { display: block; font-size: .8rem; color: var(--muted); margin-top: .25rem; line-height: 1.4; }
.role-option input:checked + label { border-color: var(--brand); background: rgba(198, 255, 61, .07); }
.role-option input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .85rem; color: var(--muted); margin: 1rem 0 1.25rem; }
.check input { margin-top: .25rem; accent-color: var(--brand); }

.state-page { text-align: center; padding: 6rem 16px; }
.state-code { font-family: var(--mono); font-size: 5rem; font-weight: 700; color: var(--brand); line-height: 1; margin-bottom: 1rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: rgba(0, 0, 0, .25); padding: 2.5rem 0; margin-top: 2rem; }
.site-footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; align-items: start; }
.footer-text { color: var(--muted); font-size: .9rem; margin-top: .75rem; max-width: 26rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.site-footer ul a { color: var(--muted); text-decoration: none; font-size: .9rem; }
.site-footer ul a:hover { color: var(--text); }
.footer-meta { display: grid; gap: .4rem; font-size: .85rem; color: var(--muted); justify-items: end; font-family: var(--mono); }
.footer-meta a { color: var(--muted); }
@media (max-width: 760px) { .site-footer-inner { grid-template-columns: 1fr; } .footer-meta { justify-items: start; } }

/* ---------- Language switch ---------- */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; margin-right: .25rem; }
.lang-switch a { font-family: var(--mono); font-size: .72rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); text-decoration: none; padding: .3rem .55rem; border-radius: 999px; }
.lang-switch a:hover { color: var(--text); }
.lang-switch a.active { background: var(--brand); color: var(--brand-ink); }
@media (max-width: 860px) { .site-nav-actions { flex-wrap: wrap; align-items: center; } .lang-switch { margin-right: auto; } }
