/* Kynexis : Auto Radar — палитра и стиль как у p2p.kynexis.eu */
@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat-800.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  --bg: #070b13;
  --panel: #0e1522;
  --panel2: #121b2b;
  --line: #1d2a40;
  --fg: #e8eef8;
  --muted: #93a1b8;
  --accent: #3ea2ff;
  --accent2: #8af0ff;
  --violet: #7b61ff;
  --good: #2fd28a;
  --bad: #ff6b6b;
  --warn: #ffb547;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --grad: linear-gradient(135deg, var(--accent) 0%, var(--violet) 100%);
  --r: 14px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f7fc;
  --panel: #ffffff;
  --panel2: #eef3fa;
  --line: #dbe4f0;
  --fg: #0d1626;
  --muted: #5d6b82;
  --accent: #1f7fe0;
  --accent2: #0aa6c9;
  --violet: #6a4ff0;
  --good: #11a868;
  --bad: #e04848;
  --warn: #d98a00;
  --shadow: 0 8px 24px rgba(20, 40, 80, .10);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(1000px 500px at 85% -10%, rgba(62, 162, 255, .12), transparent 60%),
                    radial-gradient(800px 400px at -10% 10%, rgba(123, 97, 255, .10), transparent 60%);
  background-attachment: fixed;
  color: var(--fg);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ── Шапка ─────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand-logo { width: 36px; height: 36px; border-radius: 9px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.1; }
.brand-txt b { font-family: "Montserrat", system-ui, sans-serif; font-weight: 800; letter-spacing: .14em; font-size: 15px; }
.brand-txt small { color: var(--muted); font-size: 11.5px; letter-spacing: .02em; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.pill {
  height: 36px; min-width: 36px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--fg);
  font: 600 13px/1 inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.pill.icon { padding: 0; }
.pill:hover { border-color: var(--accent); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; }
.user-chip .sub-ok { color: var(--good); }
.user-chip .sub-no { color: var(--muted); }

.btn-login { height: 36px; padding: 0 14px; white-space: nowrap; }
.btn-login .sm { display: none; }
.filters-btn { display: none; margin-left: 8px; }
.filters-btn.on { border-color: var(--accent); color: var(--accent); }

/* ── Hero ──────────────────────────────── */
.hero { padding: 26px 0 8px; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--accent2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.live { background: var(--good); box-shadow: 0 0 0 0 rgba(47, 210, 138, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(47, 210, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 210, 138, 0); } }
h1 {
  font-family: "Montserrat", system-ui, sans-serif; font-weight: 800;
  font-size: clamp(26px, 5vw, 42px); line-height: 1.08; margin: 8px 0 6px; letter-spacing: -.01em;
}
.hero p { margin: 0; }

/* ── Табы ──────────────────────────────── */
.tabs { display: flex; gap: 6px; margin: 18px 0 12px; border-bottom: 1px solid var(--line); }
.tab {
  background: none; border: 0; color: var(--muted); font: 600 14px/1 inherit; padding: 12px 14px;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 6px;
}
.tab.active { color: var(--fg); border-color: var(--accent); }
.badge { background: var(--grad); color: #fff; border-radius: 99px; font-size: 11px; padding: 2px 7px; }

/* ── Панель фильтров ───────────────────── */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px; box-shadow: var(--shadow);
}
.seg { display: inline-flex; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button {
  border: 0; background: none; color: var(--muted); font: 600 13.5px/1 inherit; padding: 9px 14px; border-radius: 9px; cursor: pointer;
}
.seg button.on { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(62, 162, 255, .3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.chip {
  border: 1px solid var(--line); background: var(--panel2); color: var(--muted);
  border-radius: 99px; padding: 7px 13px; font: 600 13px/1 inherit; cursor: pointer;
}
.chip.on { border-color: var(--accent); color: var(--fg); background: color-mix(in srgb, var(--accent) 14%, var(--panel2)); }
.chip.on::before { content: "✓ "; color: var(--accent); }

.grid-f { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; margin-top: 12px; }
.grid-f label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; min-width: 0; }
.grid-f .wide { grid-column: span 2; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
input, select {
  width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--fg); padding: 0 11px; font: 14px/1 inherit; outline: none; min-width: 0;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }

.btn {
  height: 42px; border-radius: 11px; padding: 0 18px; font: 700 14px/1 inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; color: var(--fg);
  transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(62, 162, 255, .28); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--panel2); border-color: var(--line); }
.btn.outline { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn.full { width: 100%; margin-top: 12px; }
.btn[disabled] { opacity: .6; cursor: default; }

/* ── Карточки ──────────────────────────── */
.result-head { display: flex; justify-content: space-between; align-items: center; margin: 18px 2px 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  display: flex; flex-direction: column; color: var(--fg); cursor: pointer; transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); text-decoration: none; }
.ph { position: relative; aspect-ratio: 4 / 3; background: var(--panel2); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 34px; }
.tags { position: absolute; left: 8px; top: 8px; display: flex; gap: 6px; }
.tag { font: 700 11px/1 inherit; padding: 5px 8px; border-radius: 7px; color: #fff; background: rgba(7, 11, 19, .78); backdrop-filter: blur(6px); }
.tag.olx { background: #002f34; color: #23e5db; }
.tag.otomoto { background: #e4002b; }
.tag.komornik { background: #0b3a7e; }
.tag.copart { background: #0047ba; }
.tag.iaai { background: #c8102e; }
.tag.auction { background: var(--warn); color: #1a1200; }
.age { position: absolute; right: 8px; bottom: 8px; font-size: 11.5px; color: #fff; background: rgba(7, 11, 19, .7); padding: 4px 7px; border-radius: 7px; }
.body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.price { font-family: "Montserrat", system-ui, sans-serif; font-weight: 800; font-size: 19px; }
.price small { font-family: system-ui, sans-serif; font-weight: 600; font-size: 12px; color: var(--muted); margin-left: 6px; }
.ttl { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.spec { color: var(--muted); font-size: 13px; }
.loc { color: var(--muted); font-size: 12.5px; margin-top: auto; padding-top: 4px; }
.auc { color: var(--warn); font-size: 12.5px; font-weight: 600; }

.skeleton { border-radius: var(--r); background: linear-gradient(90deg, var(--panel) 0%, var(--panel2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: sh 1.2s infinite; height: 300px; }
@keyframes sh { to { background-position: -200% 0; } }

.lock {
  margin: 16px 0; padding: 18px; border-radius: var(--r); text-align: center;
  border: 1px dashed color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--panel));
}
.lock p { margin: 0 0 12px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
#btnMore { margin: 18px auto 6px; }

/* ── Мои фильтры ───────────────────────── */
.flist { display: grid; gap: 10px; }
.fitem { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 14px; display: flex; gap: 12px; align-items: center; }
.fitem .grow { flex: 1; min-width: 0; }
.fitem b { display: block; }
.fitem .sum { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.fitem .st { font-size: 12px; font-weight: 700; }
.fitem .st.on { color: var(--good); }
.fitem .st.off { color: var(--muted); }
.fitem .ops { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.fitem .ops .btn { height: 34px; padding: 0 11px; font-size: 13px; }

/* ── Футер ─────────────────────────────── */
.foot { padding: 30px 16px 40px; text-align: center; }
.src-status { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.src-status span { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; }
.src-status span::before { content: "●"; margin-right: 5px; color: var(--good); }
.src-status span.bad::before { color: var(--bad); }

/* ── Модальные окна ────────────────────── */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(3, 6, 12, .62); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sheet-card {
  position: relative; width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 22px 18px 18px; box-shadow: var(--shadow); animation: up .18s ease;
}
@keyframes up { from { transform: translateY(14px); opacity: 0; } }
.sheet-card h3 { margin: 0 0 6px; font-family: "Montserrat", system-ui, sans-serif; font-weight: 800; }
.sheet-card label.full { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 10px; }
.x { position: absolute; right: 10px; top: 8px; border: 0; background: none; color: var(--muted); font-size: 26px; cursor: pointer; }
.plans { display: grid; gap: 8px; margin-top: 14px; }
.plan {
  display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--fg); font: 700 15px/1 inherit; cursor: pointer;
}
.plan:hover { border-color: var(--accent); }
.plan span:last-child { color: var(--warn); }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60;
  background: var(--panel2); border: 1px solid var(--line); color: var(--fg); padding: 11px 16px; border-radius: 12px;
  box-shadow: var(--shadow); font-weight: 600; max-width: calc(100% - 32px);
}

@media (max-width: 900px) {
  .grid-f { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .brand-txt small { display: none; }
  .btn-login .lg { display: none; }
  .btn-login .sm { display: inline; }
  .filters-btn { display: inline-flex; }
  .panel > .seg { width: calc(100% - 118px); display: inline-flex; vertical-align: middle; }
  .grid-f { display: none; }
  .grid-f.open { display: grid; }
  .hero { padding-top: 18px; }
  .grid-f { grid-template-columns: 1fr 1fr; gap: 8px; }
  .grid-f .wide { grid-column: span 2; }
  .actions .btn { flex: 1; }
  .seg { display: flex; }
  .seg button { flex: 1; padding: 9px 6px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tag.auction .lbl { display: none; }
  .body { padding: 9px 10px 11px; }
  .price { font-size: 16px; }
  .price small { display: block; margin: 0; }
  .spec { font-size: 12px; }
  .fitem { flex-wrap: wrap; }
  .fitem .ops { width: 100%; justify-content: flex-start; }
}
@media (max-width: 360px) {
  .cards { grid-template-columns: 1fr; }
}
