/* Public Design System 2026 */
:root {
    --color-bg: #0a0f0d;
    --color-surface: #121a16;
    --color-surface-elevated: #1a2620;
    --color-text: #eef2ef;
    --color-muted: #8fa396;
    --color-accent: #5ecf8a;
    --color-accent-hover: #7ddda3;
    --color-border: #2a3d32;
    --color-error: #f07171;
    --radius: 12px;
    --shadow: 0 8px 32px rgba(0,0,0,.35);
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-serif: 'PT Serif', Georgia, serif;
}

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

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

h1, h2, h3 { font-family: var(--font-serif); font-weight: 700; line-height: 1.2; }
a { color: var(--color-accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--color-accent-hover); }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }

.site-header {
    background: rgba(18, 26, 22, .92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 68px;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: auto;
    max-width: min(240px, 58vw);
    text-decoration: none;
}
.logo__lockup {
    display: block;
    object-fit: contain;
    flex-shrink: 0;
    width: auto;
    max-width: min(176px, 52vw);
}
.logo__lockup--compact {
    height: 38px;
    width: auto;
}
.logo__lockup--full {
    height: 52px;
    width: auto;
    max-width: min(236px, 88vw);
}
.logo__img {
    display: block;
    height: 36px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    flex-shrink: 0;
}

.nav { display: flex; align-items: center; gap: .15rem; flex-wrap: nowrap; }
.nav a, .nav button[type=submit] {
    padding: .5rem .9rem;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 500;
    color: var(--color-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.nav a:hover, .nav button:hover { color: var(--color-text); background: var(--color-surface-elevated); }
.nav a.is-active { color: var(--color-accent); background: rgba(94,207,138,.1); }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: .65rem 1.35rem;
    border-radius: var(--radius);
    font-size: .95rem; font-weight: 600;
    border: none; cursor: pointer;
    font-family: inherit;
    transition: transform .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--color-accent); color: #052e16; }
.btn--primary:hover { background: var(--color-accent-hover); color: #052e16; }
.btn--outline { background: transparent; border: 1px solid var(--color-border); color: var(--color-text); }
.btn--ghost { background: transparent; border: 1px solid transparent; color: var(--color-muted); }
.btn--ghost:hover { color: var(--color-text); background: var(--color-surface-elevated); }
.btn--sm { padding: .45rem 1rem; font-size: .875rem; }

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) + 2px);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.alert {
    padding: .85rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .9rem;
}
.alert--success { background: rgba(94,207,138,.12); color: var(--color-accent); border: 1px solid rgba(94,207,138,.25); }
.alert--error { background: rgba(240,113,113,.12); color: var(--color-error); }
.alert--info { background: rgba(94,207,138,.08); color: var(--color-text); border: 1px solid rgba(94,207,138,.2); }

/* ── Toast-уведомления (справа, как ВК) ── */
.toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .5rem;
    max-width: min(380px, calc(100vw - 2rem));
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    width: 100%;
    padding: .75rem .85rem;
    border-radius: 10px;
    background: #1a2220;
    border: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
    font-size: .875rem;
    line-height: 1.45;
    color: #e2e8f0;
    animation: toast-slide-in .28s ease;
}

.toast--success {
    border-color: rgba(94, 207, 138, .35);
    background: linear-gradient(135deg, #152019 0%, #1a2822 100%);
}

.toast--error {
    border-color: rgba(248, 113, 113, .35);
    background: linear-gradient(135deg, #221518 0%, #281a1a 100%);
}

.toast--info {
    border-color: rgba(99, 179, 237, .35);
}

.toast__icon {
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    margin-top: .1rem;
}

.toast--success .toast__icon { background: rgba(94, 207, 138, .2); color: #6ee7a8; }
.toast--error .toast__icon { background: rgba(248, 113, 113, .2); color: #fca5a5; }
.toast--info .toast__icon { background: rgba(99, 179, 237, .2); color: #93c5fd; }

.toast__text { flex: 1; min-width: 0; word-break: break-word; }

.toast__close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: rgba(255, 255, 255, .45);
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    padding: 0;
    margin: -.1rem 0 0;
}

.toast__close:hover { color: #fff; }

.toast--out {
    animation: toast-slide-out .2s ease forwards;
}

@keyframes toast-slide-in {
    from { opacity: 0; transform: translateX(1.25rem); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-slide-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(1.25rem); }
}

@media (max-width: 480px) {
    .toast-stack {
        top: auto;
        bottom: calc(1rem + env(safe-area-inset-bottom));
        right: .75rem;
        left: .75rem;
        max-width: none;
        align-items: stretch;
    }
}

.scheme-notice {
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    font-size: .9rem;
    line-height: 1.5;
    color: var(--color-text);
}
.scheme-notice--warning {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.35);
}

.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .35rem; color: var(--color-muted); }
.form-input {
    width: 100%;
    padding: .65rem .9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--color-surface-elevated);
    color: var(--color-text);
}
.form-input:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(94,207,138,.15); }

.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 2rem 0;
    margin-top: auto;
    color: var(--color-muted);
    font-size: .875rem;
}

.site-footer__inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.site-footer__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.25rem;
}

.legal-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    font-size: .8rem;
}

.legal-footer-links a {
    color: var(--color-muted);
    text-decoration: none;
}

.legal-footer-links a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.auth-page__legal {
    margin-top: 1rem;
    text-align: center;
}

.auth-page__legal .legal-footer-links {
    justify-content: center;
}

@media (max-width: 640px) {
    .site-header__inner {
        flex-wrap: nowrap;
        padding: .65rem 0;
        gap: .75rem;
    }

    .nav {
        flex: 1 1 auto;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        justify-content: flex-end;
        padding-bottom: .15rem;
    }

    .nav::-webkit-scrollbar { display: none; }

    .nav a, .nav button[type=submit] {
        flex-shrink: 0;
        white-space: nowrap;
        padding: .45rem .7rem;
        font-size: .8125rem;
    }

    .logo {
        flex-shrink: 0;
        max-width: min(200px, 62vw);
    }

    .logo__lockup--compact {
        height: 34px;
    }

    .logo__lockup--full {
        height: 46px;
    }

    .site-footer__inner {
        align-items: flex-start;
    }

    .legal-footer-links {
        flex-direction: column;
        align-items: flex-start;
        gap: .4rem;
        width: 100%;
    }

    .legal-page .legal-footer-links {
        margin-top: 1.25rem;
    }

    .grid-sidebar { grid-template-columns: 1fr !important; }

    .page-wrap { padding: 1.25rem 1rem 2rem; }

    .search-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-toolbar .form-group {
        min-width: 0;
        width: 100%;
    }

    .search-toolbar .form-group select.form-input {
        width: 100%;
    }

    .search-toolbar .btn {
        width: 100%;
    }

    .map-frame { height: min(62vh, 420px); }

    .card { padding: 1.1rem; }

    .ad-banner .container {
        flex-direction: column;
        align-items: stretch !important;
        text-align: center;
    }

    .ad-banner img {
        margin: 0 auto;
        max-width: 100% !important;
        height: auto !important;
        max-height: 72px;
    }

    .legal-consent span {
        overflow-wrap: anywhere;
    }
}

.page-wrap { padding: 2rem 1.25rem 3rem; }
.page-title { margin: 0 0 .35rem; font-size: clamp(1.5rem, 3vw, 2rem); }
.page-subtitle { color: var(--color-muted); margin: 0 0 1.5rem; }

.grid-sidebar {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    align-items: start;
}

.result-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, transform .15s;
}
.result-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-2px);
    color: inherit;
}
.result-card strong { display: block; margin-bottom: .15rem; }
.result-card .muted { color: var(--color-muted); font-size: .875rem; }
.muted { color: var(--color-muted); }

.timeline-public {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0 0 0 1.25rem;
    border-left: 2px solid var(--color-border);
}
.timeline-public li {
    padding: .35rem 0 .35rem 1rem;
    position: relative;
    font-size: .9rem;
}
.timeline-public li::before {
    content: '';
    position: absolute;
    left: -6px; top: .75rem;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--color-accent);
}
.timeline-public time {
    display: block;
    font-size: .75rem;
    color: var(--color-muted);
    margin-bottom: .15rem;
}

.person-hero {
    border-left: 4px solid var(--color-accent);
    padding-left: 1.25rem;
    margin-bottom: 1.5rem;
}

.map-frame {
    height: 520px;
    padding: 0;
    overflow: hidden;
    position: relative;
    background: #0d1511;
}

.search-toolbar {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 2rem;
}
.search-toolbar .form-group { flex: 1; min-width: 200px; margin: 0; }

.empty-state {
    text-align: center;
    color: var(--color-muted);
    padding: 2rem;
}

/* Auth pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.auth-page__bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, #0a0f0d 0%, #1a2620 40%, #243028 100%);
}
.auth-page__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 20%, rgba(94,207,138,.12), transparent 60%);
}
.auth-page__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 2rem 1.25rem;
}
.auth-page__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    max-width: 100%;
}
.auth-page__logo.logo {
    max-width: none;
}
.auth-page__foot {
    text-align: center;
    color: var(--color-muted);
    font-size: .8rem;
    margin: 1.25rem 0 0;
}
.auth-card { padding: 2rem; }
.auth-card__title { margin: 0 0 .25rem; font-size: 1.5rem; font-family: var(--font-serif); }
.auth-card__subtitle { color: var(--color-muted); margin: 0 0 1.5rem; font-size: .9rem; }
.auth-card__links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.25rem 0 0;
    font-size: .875rem;
}
.auth-form__submit { width: 100%; margin-top: .5rem; }
.auth-checkbox {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    color: var(--color-muted);
    margin-bottom: .5rem;
}

/* Data tables (import, etc.) */
.data-table-wrap { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.data-table th,
.data-table td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}
.data-table thead th {
    background: var(--color-surface-elevated);
    color: var(--color-muted);
    font-weight: 500;
}
.data-table tbody tr:hover { background: rgba(94,207,138,.04); }

.status-pill {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: lowercase;
}
.status-pill--ok { background: rgba(94,207,138,.15); color: var(--color-accent); }
.status-pill--warn { background: rgba(240,180,80,.15); color: #f0b450; }
.status-pill--muted { background: rgba(143,163,150,.15); color: var(--color-muted); }

.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.plan-card { transition: border-color .15s, transform .15s; }
.plan-card:hover { border-color: var(--color-accent); transform: translateY(-2px); }
.plan-card__price { font-size: 1.5rem; font-weight: 700; margin: 0 0 .5rem; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* ── Маркетплейс ──────────────────────────────────────────── */
.mkt-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (max-width: 860px) {
    .mkt-layout { grid-template-columns: 1fr; }
    .mkt-sidebar { order: 2; }
    .mkt-main    { order: 1; }
}

.mkt-sidebar {
    position: sticky;
    top: 80px;
}
.mkt-filter-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) + 2px);
    overflow: hidden;
}
.mkt-filter-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem 1.1rem;
    border-bottom: 1px solid var(--color-border);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--color-muted);
}
.mkt-filter-panel__head a {
    font-weight: 400;
    font-size: .8rem;
    text-transform: none;
    letter-spacing: 0;
}
.mkt-filter-section {
    padding: .9rem 1.1rem;
    border-bottom: 1px solid var(--color-border);
}
.mkt-filter-section:last-child { border-bottom: none; }
.mkt-filter-label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-muted);
    margin-bottom: .55rem;
}
.mkt-filter-input {
    width: 100%;
    padding: .55rem .8rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: .875rem;
    font-family: inherit;
    background: var(--color-surface-elevated);
    color: var(--color-text);
    transition: border-color .15s, box-shadow .15s;
}
.mkt-filter-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(94,207,138,.15);
}
.mkt-price-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
}
.mkt-toggle {
    display: flex;
    align-items: center;
    gap: .55rem;
    cursor: pointer;
    font-size: .875rem;
    color: var(--color-text);
    user-select: none;
}
.mkt-toggle input[type=checkbox] {
    width: 16px; height: 16px;
    accent-color: var(--color-accent);
    cursor: pointer;
}
.mkt-apply-btn {
    display: block;
    width: 100%;
    padding: .65rem;
    background: var(--color-accent);
    color: #052e16;
    border: none;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, transform .15s;
    text-align: center;
    margin-top: .75rem;
}
.mkt-apply-btn:hover { background: var(--color-accent-hover); transform: translateY(-1px); }

/* Шапка результатов */
.mkt-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}
.mkt-results-count {
    font-size: .875rem;
    color: var(--color-muted);
}
.mkt-results-count strong { color: var(--color-text); }
.mkt-sort-select {
    padding: .45rem .75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface-elevated);
    color: var(--color-text);
    font-size: .875rem;
    font-family: inherit;
    cursor: pointer;
}

/* Чипы активных фильтров */
.mkt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: 1rem;
}
.mkt-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .75rem;
    background: rgba(94,207,138,.12);
    color: var(--color-accent);
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s;
}
.mkt-chip:hover { background: rgba(94,207,138,.22); color: var(--color-accent); }
.mkt-chip__x { font-size: .7rem; opacity: .7; }

/* Карточка услуги */
.mkt-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) + 2px);
    padding: 1.1rem 1.25rem;
    transition: border-color .15s, transform .15s, box-shadow .15s;
    position: relative;
}
.mkt-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0,0,0,.35);
    color: inherit;
}
.mkt-card__inner {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}
.mkt-card__body { flex: 1; min-width: 0; }
.mkt-card__name {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 .2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mkt-card__org {
    font-size: .82rem;
    color: var(--color-muted);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .3rem;
    margin-bottom: .35rem;
}
.mkt-card__org-name { color: var(--color-accent); }
.mkt-card__verified {
    display: inline-block;
    background: rgba(94,207,138,.15);
    color: var(--color-accent);
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    padding: .1rem .4rem;
}
.mkt-card__location {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    font-size: .8rem;
    color: var(--color-muted);
}
.mkt-card__category {
    display: inline-block;
    background: var(--color-surface-elevated);
    color: var(--color-muted);
    border-radius: 999px;
    font-size: .75rem;
    padding: .15rem .6rem;
    margin-top: .35rem;
}
.mkt-card__desc {
    font-size: .85rem;
    color: var(--color-muted);
    margin-top: .4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mkt-card__price-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    flex-shrink: 0;
    min-width: 90px;
    text-align: right;
}
.mkt-card__price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-accent);
    white-space: nowrap;
}
.mkt-card__arrow {
    font-size: .85rem;
    color: var(--color-muted);
    margin-top: .5rem;
}

/* Автодополнение места (place-picker) */
.place-picker__list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius);
    max-height: 200px;
    overflow-y: auto;
    z-index: 300;
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
    padding: 0;
    margin: 0;
    list-style: none;
}
.place-picker__list li {
    padding: .5rem .85rem;
    cursor: pointer;
    font-size: .875rem;
    transition: background .1s;
    border-bottom: 1px solid var(--color-border);
}
.place-picker__list li:last-child { border-bottom: none; }
.place-picker__list li:hover,
.place-picker__list li[aria-selected=true] { background: rgba(94,207,138,.12); }
.place-picker__region {
    font-size: .75rem;
    color: var(--color-muted);
    margin-left: .3rem;
}

/* Автодополнение города */
.mkt-autocomplete { position: relative; }
.mkt-autocomplete__list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius);
    max-height: 200px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.mkt-autocomplete__item {
    padding: .5rem .85rem;
    cursor: pointer;
    font-size: .875rem;
    transition: background .1s;
}
.mkt-autocomplete__item:hover,
.mkt-autocomplete__item.is-active { background: rgba(94,207,138,.12); }
.mkt-autocomplete__region {
    font-size: .75rem;
    color: var(--color-muted);
    margin-left: .35rem;
}
