:root {
    --bg: #0d1016;
    --surface: #161b24;
    --surface-2: #1e2531;
    --line: #2a3140;
    --text: #e8ecf3;
    --muted: #93a0b5;
    --accent: #4d8dff;
    --accent-2: #8b5cf6;
    --ok: #34d399;
    --warn: #fbbf24;
    --radius: 14px;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg: #f6f8fc;
        --surface: #ffffff;
        --surface-2: #eef2f8;
        --line: #dde3ec;
        --text: #131720;
        --muted: #5c6880;
    }
}

* { box-sizing: border-box; }

/* [hidden] проигрывает любому явному display (напр. display:flex у карточек),
   поэтому усиливаем — иначе фильтр поиска не прячет карточки. */
[hidden] { display: none !important; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
    line-height: 1.6;
}

main { max-width: 1060px; margin: 0 auto; padding: 0 16px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.2; }
h2 { font-size: clamp(22px, 4vw, 30px); margin-top: 56px; }

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

/* header */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(140%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex; align-items: center; gap: 16px;
    max-width: 1100px; margin: 0 auto; padding: 12px 16px;
}
.logo { font-weight: 700; font-size: 19px; color: var(--text); white-space: nowrap; }
.header-search { position: relative; flex: 1; max-width: 420px; }
.header-search .search-ic {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: var(--muted); pointer-events: none;
}
.header-search input {
    width: 100%; padding: 10px 14px 10px 38px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--line);
    color: var(--text); font-size: 14px;
}
.header-search input:focus { outline: none; border-color: var(--accent); }
.header-nav { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.header-nav a { color: var(--muted); font-size: 15px; white-space: nowrap; }
.header-nav a:hover { color: var(--text); text-decoration: none; }
.header-nav .btn:hover { color: #fff; }
@media (max-width: 760px) {
    .header-inner { flex-wrap: wrap; }
    .header-search { order: 3; flex-basis: 100%; max-width: none; }
    .header-nav { gap: 12px; }
    .header-nav a:not(.btn) { display: none; }
}

/* buttons */
.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff; padding: 12px 22px; border-radius: 10px;
    font-weight: 600; border: 0; cursor: pointer; font-size: 15px;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }

/* hero */
.hero { padding: 52px 0 12px; }
.hero h1 { font-size: clamp(28px, 5.2vw, 46px); margin: 0 0 16px; letter-spacing: -0.5px; }
.lead { font-size: clamp(16px, 2.4vw, 19px); color: var(--muted); max-width: 620px; }
.hero-search { display: flex; gap: 10px; margin: 26px 0 22px; max-width: 560px; }
.hero-search input {
    flex: 1; padding: 14px 18px; border-radius: 12px; font-size: 15px;
    background: var(--surface); border: 1px solid var(--line); color: var(--text);
}
.hero-search input:focus { outline: none; border-color: var(--accent); }
.badges { list-style: none; display: flex; gap: 22px; flex-wrap: wrap; padding: 0; color: var(--muted); font-size: 15px; }

/* steps */
.steps ol { list-style: none; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--surface-2); color: var(--accent);
    font-weight: 700; font-size: 14px; margin-right: 10px;
}

/* catalog */
.cat-block { margin-top: 8px; }
.cat-title { margin: 34px 0 16px; font-size: 20px; }
.svc-grid {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* service card */
.svc-card {
    display: flex; align-items: center; gap: 14px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 14px 16px;
    color: var(--text); transition: border-color .15s, transform .15s, background .15s;
}
.svc-card:hover {
    text-decoration: none; border-color: var(--accent);
    transform: translateY(-2px); background: var(--surface-2);
}
.svc-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.svc-card-title { font-weight: 600; font-size: 15px; }
.svc-card-variants {
    color: var(--muted); font-size: 12px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.svc-card-price { color: var(--muted); font-size: 13px; }
.svc-card-arrow { margin-left: auto; color: var(--muted); transition: transform .15s, color .15s; }
.svc-card:hover .svc-card-arrow { color: var(--accent); transform: translateX(3px); }

/* service icon */
.svc-ic {
    position: relative; flex: none; border-radius: 12px;
    background: color-mix(in srgb, var(--b) 16%, var(--surface));
    display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
}
.svc-ic-img {
    position: absolute; inset: 0; margin: auto; width: 58%; height: 58%;
    object-fit: contain;
}
.svc-ic-glyph {
    position: absolute; inset: 0; color: var(--b);
    display: flex; align-items: center; justify-content: center;
}
.svc-ic-glyph svg { width: 58%; height: 58%; }
.svc-ic-mono {
    font-weight: 700; color: var(--b); font-size: 1.1em;
    display: none;
}
.svc-ic.mono { background: color-mix(in srgb, var(--b) 20%, var(--surface)); }
.svc-ic.mono .svc-ic-mono { display: block; }

/* breadcrumbs */
.crumbs { color: var(--muted); font-size: 14px; padding: 20px 0 4px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }

/* service detail */
.svc-hero {
    background: linear-gradient(160deg, color-mix(in srgb, var(--b) 14%, var(--surface)), var(--surface));
    border: 1px solid var(--line); border-radius: 18px;
    padding: 26px; margin-top: 12px;
}
.svc-hero-head { display: flex; align-items: center; gap: 18px; }
.svc-hero-head h1 { margin: 0; font-size: clamp(22px, 4vw, 30px); }
.svc-hero-tags { color: var(--muted); font-size: 14px; margin-top: 4px; }
.svc-hero-desc { color: var(--muted); margin: 16px 0 4px; max-width: 640px; }
.fulfill-group { margin: 18px 0; }
.fulfill-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.fulfill-name {
    font-weight: 700; font-size: 14px; color: var(--text);
    background: color-mix(in srgb, var(--b) 22%, var(--surface));
    padding: 4px 12px; border-radius: 999px;
}
.fulfill-note { color: var(--muted); font-size: 13px; }
.plan-list { display: flex; flex-direction: column; gap: 10px; margin: 22px 0 18px; }
.fulfill-group .plan-list { margin: 0; }
.plan-row {
    display: flex; align-items: center; gap: 14px;
    background: var(--bg); border: 1px solid var(--line);
    border-radius: 12px; padding: 14px 18px; color: var(--text);
    transition: border-color .15s, transform .15s;
}
.plan-row:hover { text-decoration: none; border-color: var(--b); transform: translateY(-1px); }
.plan-name { font-weight: 600; }
.plan-price { margin-left: auto; font-size: 18px; font-weight: 700; }
.plan-cta {
    background: var(--b); color: #fff; padding: 7px 14px; border-radius: 8px;
    font-size: 13px; font-weight: 600; filter: brightness(1.05);
}
.svc-note { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 14px; }
.svc-how ol { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.svc-how li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }

/* catalog page */
.catalog-page { padding-top: 8px; }
.page-h1 { margin: 24px 0 4px; font-size: clamp(24px, 4vw, 32px); }
.page-search { margin: 18px 0 8px; }
.page-search input {
    width: 100%; max-width: 520px; padding: 13px 16px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 15px;
}
.page-search input:focus { outline: none; border-color: var(--accent); }
@media (max-width: 480px) {
    .plan-cta { display: none; }
    .plan-price { font-size: 16px; }
}

/* faq */
.faq details {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 14px 18px; margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--muted); margin: 10px 0 0; }

/* cta */
.cta { text-align: center; padding: 64px 0 24px; }

/* footer */
.site-footer {
    border-top: 1px solid var(--line); margin-top: 64px;
    padding: 28px 16px; max-width: 1060px; margin-left: auto; margin-right: auto;
}
.site-footer div { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; }

/* legal pages */
.legal { max-width: 760px; }
.legal h2 { margin-top: 32px; font-size: 21px; }
.legal p, .legal li { color: var(--muted); }

/* ---------- admin ---------- */
.admin-wrap { max-width: 1160px; margin: 0 auto; padding: 16px; }
.admin-nav { display: flex; gap: 16px; align-items: center; margin-bottom: 24px; flex-wrap: wrap; }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 28px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.tile .value { font-size: 26px; font-weight: 700; }
.tile .label { color: var(--muted); font-size: 14px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px; }

input[type=text], input[type=number], input[type=password], select {
    background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
    border-radius: 8px; padding: 8px 10px; font-size: 14px; width: 100%;
}
input[type=number] { max-width: 110px; }
select { max-width: 90px; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-new { background: #3a3f4d; color: var(--muted); }
.badge-paid { background: rgba(251,191,36,.16); color: var(--warn); }
.badge-in_progress { background: rgba(77,141,255,.16); color: var(--accent); }
.badge-done { background: rgba(52,211,153,.16); color: var(--ok); }
.badge-cancelled, .badge-refunded { background: rgba(239,68,68,.16); color: #f87171; }

.login-box {
    max-width: 380px; margin: 12vh auto; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
}
.login-box h1 { font-size: 22px; margin-top: 0; }
.error { color: #f87171; font-size: 14px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions button { padding: 6px 10px; font-size: 13px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; }
.actions button:hover { border-color: var(--accent); }
.profit { color: var(--ok); font-weight: 600; }

/* строка с курсом валют в админке: текст и кнопка на одной линии */
.fx-line {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 16px 0;
}
.fx-line form { margin: 0; }
