html {
    overflow-y: scroll; /* всегда рисуем вертикальный скроллбар */
}


:root {
    --bg: #05060a;
    --bg-elevated: #10131a;
    --bg-soft: #151924;
    --border-subtle: #262b3a;
    --accent: #ffb400;
    --accent-soft: rgba(255, 180, 0, 0.12);
    --accent-hover: #ffc94d;
    --text: #f5f5f5;
    --muted: #9ca3b8;
    --danger: #ff4c4c;
    --radius-card: 16px;
    --shadow-soft: 0 14px 45px rgba(0, 0, 0, 0.55);
    --transition-fast: 0.18s ease-out;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}


body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top, #1b2033 0, #05060a 55%, #020308 100%);
    color: var(--text);
    line-height: 1.6;
}

/* Ссылки и базовые элементы */

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

a:hover {
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Контейнер и базовая сетка */

.container {
    width: min(1180px, 100% - 32px);
    margin: 0 auto;
}

.content {
    padding: 24px 0 40px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(260px, 1.1fr);
    gap: 24px;
}

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

/* Хедер */

.header {
    background: rgba(5, 6, 10, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    gap: 16px;
}

.logo {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.logo-main {
    font-size: 18px;
}

.logo-sub {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--muted);
}

/* Навигация */

.nav {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.nav-link {
    padding: 6px 12px;
    border-radius: 999px;
    color: var(--muted);
    border: 1px solid transparent;
    transition: background var(--transition-fast),
                color var(--transition-fast),
                border-color var(--transition-fast),
                transform 0.08s ease-out;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.04);
    transform: translateY(-1px);
}

.nav-link--active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: rgba(255, 180, 0, 0.35);
}

/* Кнопки */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--transition-fast),
                color var(--transition-fast),
                border-color var(--transition-fast),
                transform 0.08s ease-out,
                box-shadow 0.12s ease-out;
}

.btn-primary {
    background: var(--accent);
    color: #18120a;
    box-shadow: 0 10px 30px rgba(255, 180, 0, 0.35);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 14px 40px rgba(255, 180, 0, 0.5);
}

.btn-ghost {
    background: transparent;
    color: var(--accent);
    border-color: rgba(255, 180, 0, 0.5);
}

.btn-ghost:hover {
    background: var(--accent-soft);
}

.btn-secondary {
    background: #1e2433;
    color: var(--text);
    border-color: #282f43;
}

.btn-secondary:hover {
    background: #252c3f;
}

.btn-full {
    width: 100%;
    background: var(--accent);
    color: #18120a;
    border-color: var(--accent);
}

.btn-full:hover {
    background: var(--accent-hover);
}

.btn-outline {
    border-color: var(--border-subtle);
    color: var(--text);
    background: transparent;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Hero */

.hero {
    background: radial-gradient(circle at top left, rgba(255, 180, 0, 0.06), rgba(7, 10, 18, 0.96));
    border-radius: var(--radius-card);
    padding: 20px 20px 18px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero h1 {
    font-size: 22px;
    margin: 0 0 8px;
}

.hero p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 14px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Фильтры */

.filters {
    background: var(--bg-elevated);
    border-radius: var(--radius-card);
    padding: 14px 14px 12px;
    margin-bottom: 18px;
    border: 1px solid var(--border-subtle);
}

.filters-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr) auto;
    gap: 12px;
    align-items: flex-end;
}

@media (max-width: 900px) {
    .filters-row {
        grid-template-columns: 1fr;
    }
}

.filters-group label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
    letter-spacing: 0.06em;
}

.filters-group input,
.filters-group select {
    width: 100%;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: #080a10;
    color: var(--text);
    padding: 7px 10px;
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.filters-group input:focus,
.filters-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(255, 180, 0, 0.4);
    background: #05060a;
}

.filters-age {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 6px;
}

.filters-age span {
    color: var(--muted);
    font-size: 12px;
}

.filters-actions {
    display: flex;
    justify-content: flex-end;
}

/* Блоки контента */

.page-block {
    background: var(--bg-elevated);
    border-radius: var(--radius-card);
    padding: 16px 16px 14px;
    margin-bottom: 18px;
    border: 1px solid var(--border-subtle);
}

.page-title {
    font-size: 20px;
    margin: 0 0 10px;
}

.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.block-title {
    font-size: 18px;
    margin: 0;
}

.block-link {
    font-size: 13px;
    color: var(--accent);
}

.block-link:hover {
    text-decoration: underline;
}

/* Профили – список */

.profile-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

/* Карточка профиля (маленькая) */

.profile-card-small {
    background: var(--bg-soft);
    border-radius: 12px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 10px;
    align-items: center;
    transition: border-color var(--transition-fast),
                transform var(--transition-fast),
                box-shadow 0.16s ease-out,
                background var(--transition-fast);
}

.profile-card-small:hover {
    border-color: rgba(255, 180, 0, 0.5);
    background: #191e2b;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
}

.profile-card-small-photo {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #11141c;
}

.profile-card-small-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-card-small-body {
    flex: 1;
    min-width: 0;
}

.profile-card-small-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.profile-card-small-meta {
    font-size: 13px;
    color: var(--muted);
}

.profile-card-small-city {
    font-size: 12px;
    color: var(--muted);
}

/* Сайдбар */

.layout-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sidebar-block {
    background: rgba(10, 12, 18, 0.96);
    border-radius: var(--radius-card);
    padding: 14px 14px 12px;
    border: 1px solid var(--border-subtle);
}

.sidebar-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 8px;
}

.sidebar-body {
    font-size: 14px;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

/* Страница полной анкеты (ProfileTemplate уже использует эти классы) */

.profile-page .page-header {
    margin-bottom: 12px;
}

.profile-page .page-title {
    font-size: 22px;
    margin: 0 0 4px;
}

.page-subtitle {
    font-size: 13px;
    color: var(--muted);
}

.profile-card-full {
    background: var(--bg-elevated);
    border-radius: var(--radius-card);
    padding: 16px 16px 14px;
    border: 1px solid var(--border-subtle);
}

.profile-main-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.profile-name {
    font-size: 18px;
    font-weight: 600;
}

.profile-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.profile-meta-item {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
}

.profile-photo {
    margin-bottom: 12px;
}

.profile-section {
    margin-top: 8px;
}

.profile-section-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 4px;
}

.profile-section-body {
    font-size: 14px;
}

/* Футер */

.footer {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding: 12px 0 16px;
    background: rgba(5, 6, 10, 0.96);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
}

.footer-meta {
    opacity: 0.7;
}

/* Базовые стили шапки */
.header {
    background: #0f172a;
    color: #fff;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
}

.logo {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.logo-main {
    font-weight: 700;
    font-size: 18px;
}

.logo-sub {
    font-size: 12px;
    color: #9ca3b8;
}

/* Навигация на десктопе */
.nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link {
    text-decoration: none;
    font-size: 14px;
    color: #e5e7eb;
    padding: 6px 10px;
    border-radius: 999px;
    transition: background .2s, color .2s;
}

.nav-link:hover {
    background: rgba(148,163,184,.2);
    color: #fff;
}

.nav-link--active {
    background: #f97316;
    color: #111827;
}

/* Кнопка-бургер (по умолчанию скрыта на десктопе) */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: #e5e7eb;
    border-radius: 999px;
    transition: transform .2s, opacity .2s;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .header-inner {
        padding: 8px 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav {
        position: absolute;
        left: 0;
        right: 0;
        top: 56px; /* чуть ниже шапки */
        background: #0f172a;
        border-top: 1px solid rgba(148,163,184,.3);
        display: none;
        flex-direction: column;
        padding: 8px 16px 12px;
        gap: 4px;
        z-index: 50;
    }

    .nav.nav--open {
        display: flex;
    }

    .nav-link {
        display: block;
        padding: 8px 10px;
        border-radius: 8px;
    }

    /* Анимация крестика */
    .nav-toggle.nav-toggle--open span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .nav-toggle.nav-toggle--open span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.nav-toggle--open span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }
}
