:root {
    --bg: radial-gradient(circle at 20% 20%, #101425 0%, #05060f 55%, #020207 100%);
    --fg: #f4f8ff;
    --muted: #9aa7c1;
    --accent: #5d7bff;
    --accent-soft: rgba(93, 123, 255, 0.12);
    --accent-strong: linear-gradient(135deg, #6d86ff 0%, #9f6fff 100%);
    --card: rgba(13, 18, 35, 0.8);
    --border: rgba(108, 126, 255, 0.25);
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--fg);
}

body.app-public {
    background: var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

.neuro-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(18px);
    background: rgba(5, 8, 20, 0.85);
    border-bottom: 1px solid var(--border);
}

.neuro-header__inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.neuro-brand {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.04em;
}

.neuro-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
    margin-right: 6px;
}

.lang-switch a {
    color: var(--fg);
    opacity: 0.7;
}

.lang-switch a:hover {
    opacity: 1;
}

.lang-active {
    font-weight: 600;
    color: #fff;
}

.neuro-user {
    font-size: 14px;
    color: var(--muted);
}

.neuro-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    background: var(--accent-strong);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.neuro-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(93, 123, 255, 0.28);
}

.flash {
    max-width: 960px;
    margin: 12px auto 0;
    padding: 12px 16px;
    border-radius: 14px;
    backdrop-filter: blur(14px);
    background: rgba(36, 46, 86, 0.65);
    border: 1px solid rgba(93, 123, 255, 0.25);
}

.neuro-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 20px 80px;
}

.neuro-footer {
    position: relative;
    padding: 28px 18px 40px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.neuro-footer__inner {
    max-width: 960px;
    margin: 0 auto;
}

.hero {
    text-align: center;
    padding: 40px 0 30px;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: rgba(93, 123, 255, 0.12);
    color: #93a4ff;
}

.hero-title {
    margin: 18px auto 14px;
    max-width: 760px;
    font-size: clamp(32px, 6vw, 54px);
    line-height: 1.12;
    font-weight: 700;
}

.hero-subtitle {
    max-width: 720px;
    margin: 0 auto;
    font-size: 18px;
    color: var(--muted);
    line-height: 1.6;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 30px;
}

.hero-stat {
    padding: 18px 20px;
    border-radius: 18px;
    background: rgba(20, 26, 48, 0.85);
    border: 1px solid rgba(93, 123, 255, 0.16);
    box-shadow: 0 20px 40px rgba(12, 17, 36, 0.45);
}

.hero-stat strong {
    font-size: 22px;
}

.hero-stat span {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--muted);
}

.feature-section {
    margin: 50px 0 40px;
}

.neuro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.neuro-card {
    padding: 20px 22px;
    border-radius: 20px;
    background: var(--card);
    border: 1px solid rgba(93, 123, 255, 0.18);
    box-shadow: 0 16px 36px rgba(6, 10, 24, 0.54);
}

.neuro-card h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.neuro-card p {
    margin: 0;
    font-size: 15px;
    color: var(--muted);
    line-height: 1.65;
}

.auth-section {
    margin-top: 60px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    align-items: start;
}

.login-card {
    background: rgba(18, 23, 46, 0.9);
    border: 1px solid rgba(93, 123, 255, 0.2);
    border-radius: 24px;
    padding: 28px 30px;
    box-shadow: 0 24px 50px rgba(4, 8, 22, 0.55);
}

.login-card.register-card {
    background: rgba(20, 26, 48, 0.92);
}

.login-card h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 22px;
}

.login-card p {
    margin-top: 0;
    margin-bottom: 24px;
    color: var(--muted);
    line-height: 1.6;
}

.login-card form {
    display: grid;
    gap: 16px;
}

.login-card label {
    font-size: 14px;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-card input {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(93, 123, 255, 0.25);
    background: rgba(10, 14, 28, 0.9);
    color: var(--fg);
    font-size: 15px;
}

.login-card button {
    padding: 12px 18px;
    border-radius: 14px;
    background: var(--accent-strong);
    border: none;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-card button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 35px rgba(109, 134, 255, 0.35);
}

.register-hint {
    margin-top: 16px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

.registration-success {
    margin: 40px 0 10px;
}

.registration-success__card {
    background: rgba(16, 22, 40, 0.92);
    border: 1px solid rgba(109, 133, 255, 0.25);
    border-radius: 22px;
    padding: 24px 26px;
    text-align: center;
    box-shadow: 0 20px 45px rgba(6, 10, 24, 0.5);
}

.registration-success__card h3 {
    margin: 0 0 12px;
    font-size: 24px;
}

.registration-success__card p {
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.6;
}

.registration-success__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 999px;
    background: var(--accent-strong);
    color: #fff;
    font-weight: 600;
}

.hero-ru {
    margin-top: 60px;
}

.login-meta-section {
    margin-top: 40px;
}

.login-meta {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.login-meta li {
    padding: 14px 18px;
    border-radius: 18px;
    background: rgba(16, 20, 36, 0.9);
    border: 1px solid rgba(93, 123, 255, 0.18);
    color: var(--muted);
    line-height: 1.6;
}

/* Forms and buttons (global) */

input,
select,
textarea,
button {
    font-family: inherit;
    color: inherit;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
select,
textarea {
    background: rgba(14, 20, 38, 0.9);
    border: 1px solid rgba(93, 123, 255, 0.28);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(109, 133, 255, 0.75);
    box-shadow: 0 0 0 3px rgba(109, 133, 255, 0.2);
    background: rgba(18, 24, 46, 0.95);
}

input[disabled],
select[disabled],
textarea[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(12, 16, 30, 0.6);
}

input::placeholder,
textarea::placeholder {
    color: rgba(154, 167, 193, 0.6);
}

/* Убираем белые спиннеры в Chrome для number */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

button {
    background: rgba(26, 34, 54, 0.9);
    color: var(--fg);
    border: 1px solid rgba(93, 123, 255, 0.3);
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button.primary {
    background: var(--accent-strong);
    border: none;
    color: #fff;
}

button.secondary {
    background: rgba(30, 40, 70, 0.85);
    border: 1px solid rgba(93, 123, 255, 0.35);
}

button.danger {
    background: var(--danger);
    border: none;
    color: #fff;
}

button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

button:hover:not([disabled]) {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(93, 123, 255, 0.3);
}

button.secondary:hover:not([disabled]) {
    box-shadow: 0 10px 28px rgba(60, 90, 150, 0.25);
}

button.danger:hover:not([disabled]) {
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.35);
}

.payment-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.payment-link:hover {
    color: #fff;
    text-decoration: underline;
}

.topup-form input[type="number"] {
    background: rgba(18, 24, 42, 0.95);
    color: var(--fg);
    border: 1px solid rgba(93, 123, 255, 0.3);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 15px;
}

.topup-form input[type="number"]:focus {
    outline: none;
    border-color: rgba(109, 133, 255, 0.7);
    box-shadow: 0 0 0 3px rgba(109, 133, 255, 0.25);
}

/* Tables for admin pages */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: rgba(15, 20, 38, 0.85);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(93, 123, 255, 0.18);
    box-shadow: 0 18px 40px rgba(5, 8, 20, 0.6);
}

th,
td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(93, 123, 255, 0.12);
    text-align: left;
}

thead th {
    background: rgba(20, 26, 48, 0.95);
    font-weight: 600;
}

tbody tr:hover {
    background: rgba(31, 40, 78, 0.55);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(93, 123, 255, 0.3);
    background: rgba(36, 45, 86, 0.85);
    color: var(--fg);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.card {
    padding: 18px;
    border-radius: 18px;
    background: rgba(14, 19, 36, 0.9);
    border: 1px solid rgba(93, 123, 255, 0.2);
}

.card .muted {
    color: var(--muted);
    font-size: 13px;
}

.card .big {
    font-size: 26px;
    margin-top: 6px;
}

code {
    padding: 4px 6px;
    border-radius: 10px;
    background: rgba(22, 28, 52, 0.9);
    border: 1px solid rgba(93, 123, 255, 0.18);
}

.admin-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.pill.pill-active {
    background: var(--accent-strong);
    color: #fff;
    border-color: transparent;
}

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.admin-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-toolbar__actions form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-toolbar__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 14px;
    color: var(--muted);
}

.filters-grid {
    display: grid;
    gap: 14px 18px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-bottom: 22px;
    padding: 18px 20px;
    border-radius: 18px;
    background: rgba(14, 18, 36, 0.85);
    border: 1px solid rgba(93, 123, 255, 0.16);
}

.filters-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: var(--muted);
}

.filters-grid input,
.filters-grid select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(93, 123, 255, 0.25);
    background: rgba(10, 14, 28, 0.9);
    color: var(--fg);
    font-size: 14px;
}

.filters-grid__buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.link-muted {
    color: var(--muted);
}

.link-muted:hover {
    color: #fff;
}

.table-scroll {
    border-radius: 18px;
    border: 1px solid rgba(93, 123, 255, 0.16);
    background: rgba(15, 20, 38, 0.75);
    overflow: auto;
}

.table-scroll table {
    margin: 0;
    border: none;
    box-shadow: none;
}

.table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(20, 26, 48, 0.95);
}

.data-table {
    min-width: 960px;
}

.data-table td,
.data-table th {
    vertical-align: top;
}

.cell-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.cell-sub {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 4px;
}

.cell-sub:last-child {
    margin-bottom: 0;
}

.mono {
    font-family: 'Fira Code', 'Consolas', monospace;
    overflow-wrap: anywhere;
}

.stat-grid {
    display: grid;
    gap: 6px;
    font-size: 14px;
}

.inline-form {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.inline-form label {
    font-size: 12px;
    color: var(--muted);
    align-self: center;
}

.inline-form input,
.inline-form select {
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(93, 123, 255, 0.25);
    background: rgba(12, 16, 32, 0.9);
    color: var(--fg);
    font-size: 13px;
}

.inline-form button {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
}

.inline-form--stretch {
    width: 100%;
}

.inline-form--stretch input,
.inline-form--stretch select {
    flex: 1 1 auto;
    min-width: 0;
}

.inline-form--stretch button {
    white-space: nowrap;
}

.form-grid {
    display: grid;
    gap: 14px 18px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
}

.form-actions {
    display: flex;
    align-items: flex-end;
}

.tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(26, 34, 58, 0.8);
    border: 1px solid rgba(93, 123, 255, 0.25);
    font-size: 12px;
    color: var(--muted);
}

.badge--muted {
    background: rgba(18, 24, 42, 0.7);
}

.badge--accent {
    background: rgba(93, 123, 255, 0.15);
    color: #b8c5ff;
    border-color: rgba(93, 123, 255, 0.35);
}

.users-table {
    min-width: 960px;
}

.users-actions {
    display: grid;
    gap: 10px;
    justify-items: end;
}

.users-actions .inline-form {
    margin-top: 0;
    justify-content: flex-end;
}

.uploads-grid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.empty-placeholder {
    padding: 36px;
    text-align: center;
    border-radius: 20px;
    background: rgba(14, 19, 36, 0.8);
    border: 1px solid rgba(93, 123, 255, 0.16);
    color: var(--muted);
}

.upload-card {
    padding: 20px 22px;
    border-radius: 22px;
    background: rgba(14, 19, 36, 0.88);
    border: 1px solid rgba(93, 123, 255, 0.16);
    box-shadow: 0 16px 40px rgba(6, 10, 24, 0.45);
    display: grid;
    gap: 18px;
}

.upload-card__header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
}

.upload-card__title {
    font-size: 18px;
    font-weight: 600;
}

.upload-card__meta {
    font-size: 13px;
    color: var(--muted);
}

.upload-card__path {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}

.upload-card__tools {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.upload-card__checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 12px;
    border: 1px dashed rgba(93, 123, 255, 0.35);
    color: var(--muted);
    font-size: 13px;
}

.upload-card__checkbox input {
    width: 18px;
    height: 18px;
}

.upload-card__body {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.upload-card__block {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(18, 24, 44, 0.78);
    border: 1px solid rgba(93, 123, 255, 0.12);
}

.upload-card__blockTitle {
    font-weight: 600;
    font-size: 14px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-vertical {
    display: grid;
    gap: 10px;
}

.link-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(50, 68, 132, 0.6);
    border: 1px solid rgba(93, 123, 255, 0.3);
    font-size: 13px;
    color: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.link-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(93, 123, 255, 0.28);
}

.align-right {
    text-align: right;
}

.admin-section {
    margin-bottom: 32px;
    padding: 22px 24px;
    border-radius: 22px;
    background: rgba(12, 17, 34, 0.8);
    border: 1px solid rgba(93, 123, 255, 0.16);
    box-shadow: 0 18px 38px rgba(4, 6, 16, 0.55);
}

.admin-section__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 20px;
}

.admin-section__header h2 {
    margin: 0;
}

.cards--tight {
    margin: 0;
    gap: 14px;
}

.cards--secondary {
    margin-top: 18px;
}

.cards--secondary .card {
    background: rgba(18, 24, 46, 0.85);
}

.action-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.action-card {
    padding: 18px;
    border-radius: 18px;
    background: rgba(16, 22, 40, 0.85);
    border: 1px solid rgba(93, 123, 255, 0.18);
    display: grid;
    gap: 12px;
}

.action-card h3 {
    margin: 0;
    font-size: 18px;
}

.action-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.action-card--wide {
    grid-column: span 2;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.settings-card {
    display: grid;
    gap: 12px;
}

.settings-card label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--muted);
}

.settings-card input {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(93, 123, 255, 0.25);
    background: rgba(10, 14, 28, 0.92);
    color: var(--fg);
}

.taxonomy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.taxonomy-column h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.taxonomy-column .inline-form {
    margin-bottom: 14px;
}

.pagination-bar {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 14px;
}

.pagination-link {
    padding: 8px 14px;
    border-radius: 12px;
    border: 1px solid rgba(93, 123, 255, 0.25);
    background: rgba(22, 28, 52, 0.85);
}

.pagination-link.disabled {
    opacity: 0.45;
    pointer-events: none;
}

@media (max-width: 640px) {
    .neuro-header__inner,
    .neuro-main {
        padding: 18px 16px;
    }

    .hero {
        padding: 32px 0 24px;
    }

    .auth-section {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .data-table {
        min-width: 720px;
    }

    .action-card--wide {
        grid-column: auto;
    }

    .upload-card__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .upload-card__tools {
        width: 100%;
        align-items: flex-start;
    }
}
