/* ─────────────────────────────────────────────────────────────────────────
   NeuroMateX — тёмная техно-минималистичная тема.
   Общий каркас для лендинга, входа и личного кабинета:
   тикеры, вертикальные разделители, сайдбар, карточки, кнопки, формы.
   ───────────────────────────────────────────────────────────────────────── */

:root {
    color-scheme: dark;

    --bg: #090909;
    --line: rgba(255, 255, 255, .08);
    --line-soft: rgba(255, 255, 255, .06);
    --line-strong: rgba(255, 255, 255, .22);
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, .58);
    --text-dim: rgba(255, 255, 255, .4);
    --text-faint: rgba(255, 255, 255, .3);
    /* Непрозрачные эквиваленты rgba(255,255,255,.022/.045) поверх #090909 —
       чтобы точки dot-grid не просвечивали сквозь карточки */
    --surface: #0e0e0e;
    --surface-hover: #141414;
    --ok: rgba(160, 255, 180, .85);
    --err: rgba(255, 130, 130, .9);

    --font-display: 'Space Grotesk', sans-serif;
    --font-label: 'Manrope', sans-serif;

    --edge: 26px;
    --bar: 42px;
    --nav-w: 158px;
    --radius: 14px;
    --radius-sm: 8px;

    --focus-ring: 2px solid rgba(255, 255, 255, .55);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    color: var(--text);
    font-family: var(--font-display);
    max-width: 100%;
    overflow-x: hidden;
}

/* Фон только на html: прозрачный body не перекрывает канвас
   .dot-grid с z-index: -1 */
html {
    background: var(--bg);
}

body {
    background: transparent;
}

body.nx-locked {
    height: 100%;
    overflow: hidden;
}

a {
    color: inherit;
}

/* ── Focus visibility (keyboard nav) ─────────────────────────────────── */

.nx-app :focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
    outline: var(--focus-ring);
    outline-offset: 2px;
}

/* ── Skip link ────────────────────────────────────────────────────────── */

.skip-link {
    position: fixed;
    top: -100px;
    left: 12px;
    z-index: 999;
    background: #fff;
    color: #000;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: top .15s;
}

.skip-link:focus {
    top: 12px;
}

/* ── Frame ────────────────────────────────────────────────────────────── */

.nx-frame {
    position: fixed;
    left: var(--edge);
    right: var(--edge);
    top: var(--bar);
    bottom: var(--bar);
    border: 1px solid rgba(255, 255, 255, .05);
    pointer-events: none;
    z-index: 5;
}

.nx-bgg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: .02;
}

.nx-bgg::before, .nx-bgg::after {
    content: '';
    position: absolute;
}

.nx-bgg::before {
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #fff;
}

.nx-bgg::after {
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #fff;
}

/* ── Marquee tickers ──────────────────────────────────────────────────── */

.nx-tk {
    position: fixed;
    left: 0;
    right: 0;
    height: var(--bar);
    display: flex;
    align-items: center;
    overflow: hidden;
    z-index: 40;
    background: #090909;
    backdrop-filter: blur(12px);
}

.nx-tk--top {
    top: 0;
    border-bottom: 1px solid var(--line);
}

.nx-tk--bottom {
    bottom: 0;
    border-top: 1px solid var(--line);
}

.nx-tki {
    display: flex;
    width: max-content;
    white-space: nowrap;
}

.nx-tki--a {
    animation: nx-tkh 34s linear infinite;
}

.nx-tki--b {
    animation: nx-tkh 27s linear infinite reverse;
}

@media (prefers-reduced-motion: reduce) {
    .nx-tki--a, .nx-tki--b {
        animation: none;
    }
}

.nx-tki span {
    font-size: 11px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .32);
    padding: 0 20px;
    font-family: var(--font-label);
}

.nx-tki span.dim {
    color: rgba(255, 255, 255, .14);
}

@keyframes nx-tkh {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── Vertical tickers ─────────────────────────────────────────────────── */

.nx-vtk {
    position: fixed;
    top: var(--bar);
    bottom: var(--bar);
    width: var(--edge);
    overflow: hidden;
    z-index: 34;
    background: #090909;
}

.nx-vtk--l { left: 0; }
.nx-vtk--r { right: 0; }

.nx-vtki {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nx-vtki--a { animation: nx-vtkv 42s linear infinite; }
.nx-vtki--b { animation: nx-vtkv 34s linear infinite reverse; }

@media (prefers-reduced-motion: reduce) {
    .nx-vtki--a, .nx-vtki--b {
        animation: none;
    }
}

@keyframes nx-vtkv {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

.nx-vtki span {
    writing-mode: vertical-rl;
    font-size: 8px;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .18);
    padding: 13px 0;
    font-family: var(--font-label);
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

.btn {
    background: #151515;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    min-height: 44px;
    font-size: 9.5px;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .7);
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
    font-family: var(--font-display);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    background: #222222;
    color: #fff;
    border-color: rgba(255, 255, 255, .28);
}

.btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.btn--w,
.btn--primary {
    background: #222222;
    border-color: rgba(255, 255, 255, .24);
    color: #fff;
}

.btn--w:hover,
.btn--primary:hover {
    background: #303030;
}

.btn--ghost {
    background: transparent;
}

.btn--block {
    width: 100%;
}

/* ── Cards ────────────────────────────────────────────────────────────── */

.nx-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    transition: border-color .25s, background .25s;
}

.nx-card--hover:hover {
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, .18);
}

.nx-card--featured {
    border-color: rgba(255, 255, 255, .2);
}

.nx-eyebrow {
    font-size: 8px;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 10px;
    font-family: var(--font-label);
}

.nx-badge {
    font-size: 9px;
    letter-spacing: .07em;
    color: rgba(255, 255, 255, .8);
    background: #1f1f1f;
    border-radius: 999px;
    padding: 3px 10px;
    display: inline-block;
    margin-bottom: 11px;
}

/* ── Inputs ───────────────────────────────────────────────────────────── */

.nx-field {
    margin-bottom: 16px;
}

.nx-field label {
    display: block;
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-family: var(--font-label);
}

.nx-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, .16);
    padding: 12px 2px;
    min-height: 44px;
    color: #fff;
    font-size: 15px;
    font-family: var(--font-display);
}

.nx-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, .5);
}

.nx-input::placeholder {
    color: rgba(255, 255, 255, .3);
}

.nx-error {
    background: rgba(255, 92, 92, .1);
    border: 1px solid rgba(255, 92, 92, .4);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--err);
    margin-bottom: 16px;
}

.nx-success {
    background: rgba(120, 255, 160, .08);
    border: 1px solid rgba(120, 255, 160, .35);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--ok);
    margin-bottom: 16px;
}

/* ── Info bars ────────────────────────────────────────────────────────── */

.nx-ibar {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 11px;
    background: #0d0d0d;
}

.nx-ibar p {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.55;
}

.nx-ibar p b {
    color: rgba(255, 255, 255, .88);
}

.nx-ibar a, .nx-ibar button.nx-link {
    color: rgba(255, 255, 255, .8);
    cursor: pointer;
    text-decoration: underline;
    background: none;
    border: none;
    font: inherit;
    padding: 0;
}

/* ── Visually-hidden (screen-reader only) helper ─────────────────────── */

.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;
}

/* ── Progress bar ─────────────────────────────────────────────────────── */

.nx-pb {
    height: 3px;
    background: rgba(255, 255, 255, .1);
    border-radius: 999px;
    width: 100%;
    position: relative;
    overflow: hidden;
    margin: 6px 0;
}

.nx-pf {
    height: 100%;
    background: rgba(255, 255, 255, .6);
    position: absolute;
    left: 0;
    top: 0;
}

/* ── Toasts (override base look to match theme) ──────────────────────── */

#toast-root {
    position: fixed;
    top: calc(var(--bar) + 16px);
    right: 16px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 18px;
    background: #090909;
    border: 1px solid var(--line);
    font-size: 13px;
    max-width: 320px;
}

/* ── Responsive: hide decorative chrome on small screens ─────────────── */

@media (max-width: 860px) {
    :root {
        --edge: 0px;
        --bar: 34px;
    }

    .nx-vtk {
        display: none;
    }

    .nx-frame {
        display: none;
    }
}

@media (max-width: 560px) {
    :root {
        --bar: 30px;
    }

    .nx-tki span {
        font-size: 9px;
        padding: 0 12px;
    }
}
