/* =========================================================================
   BLACK MARKET — дизайн-система
   Монохромная палитра, типографика Unbounded (заголовки) + Manrope (текст).
   ========================================================================= */

:root {
  /* Палитра */
  --bg: #0B0B0D;
  --bg-2: #141416;
  --card: #1A1A1D;
  --card-2: #202024;
  --line: #26262B;
  --line-2: #323238;
  --text: #FFFFFF;
  --text-2: #929292;
  --text-3: #5E5E66;
  --accent: #FFFFFF;
  --accent-ink: #0B0B0D;
  --ok: #D9F99D;        /* приглушённые сигнальные цвета — используются точечно */
  --warn: #FDE68A;
  --danger: #FCA5A5;

  /* Типографика */
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Unbounded", "Manrope", system-ui, sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 15px; --fs-lg: 17px;
  --fs-h3: 18px; --fs-h2: clamp(22px, 2.4vw, 30px); --fs-h1: clamp(30px, 4vw, 46px);

  /* Геометрия */
  --r-xs: 6px; --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;
  --gap: 16px;
  --container: 1280px;
  --header-h: 68px;

  /* Движение */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: .15s var(--ease);
  --t: .28s var(--ease);
  --t-slow: .6s var(--ease);

  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 40px -20px rgba(0,0,0,.6);
  --focus: 0 0 0 3px rgba(255,255,255,.22);
  color-scheme: dark;
}

/* ------------------------------------------------------------- reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 500 var(--fs-md)/1.55 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.15; letter-spacing: -.01em; font-weight: 700; }
h1 { font: 700 var(--fs-h1)/1.08 var(--font-display); letter-spacing: -.03em; }
h2 { font: 700 var(--fs-h2)/1.15 var(--font-display); letter-spacing: -.02em; }
h3, .h3 { font-size: var(--fs-h3); font-family: var(--font); }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
details summary { list-style: none; cursor: pointer; }
details summary::-webkit-details-marker { display: none; }
[hidden] { display: none !important; }
::selection { background: #fff; color: #000; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-xs); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ic--sm { width: 14px; height: 14px; }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.text-dim { color: var(--text-3); }
.lead { font-size: var(--fs-lg); max-width: 720px; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: #fff; color: #000; padding: 8px 14px; border-radius: var(--r-sm); }
.skip-link:focus { left: 8px; }

/* Скроллбар */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid var(--bg); }

/* ----------------------------------------------------------- buttons --- */
.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 20px; border-radius: var(--r-pill);
  font-weight: 700; font-size: var(--fs-md); white-space: nowrap; letter-spacing: -.005em;
  border: 1px solid transparent; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  position: relative; isolation: isolate; overflow: hidden;
}
.btn:active { transform: scale(.98); }
.btn--sm { --h: 36px; padding: 0 14px; font-size: var(--fs-sm); }
.btn--lg { --h: 52px; padding: 0 26px; font-size: var(--fs-lg); }
.btn--block { width: 100%; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary::after { /* блик при наведении */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(0,0,0,.08) 50%, transparent 70%);
  transform: translateX(-100%); transition: transform .6s var(--ease);
}
.btn--primary:hover::after { transform: translateX(100%); }
.btn--primary:hover { background: #E8E8EA; }
.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn--ghost:hover { border-color: var(--text-2); background: rgba(255,255,255,.03); }
.btn--text { height: auto; padding: 6px 4px; color: var(--text-2); border-radius: var(--r-sm); }
.btn--text:hover { color: var(--text); }
.btn[disabled], .btn.is-loading { opacity: .5; pointer-events: none; }

.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: var(--r-pill);
  color: var(--text-2); transition: background var(--t-fast), color var(--t-fast); position: relative;
}
.icon-btn:hover { color: var(--text); background: var(--card); }
.icon-btn__dot { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--bg); }

.link-arrow { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; transition: color var(--t-fast), gap var(--t-fast); }
.link-arrow:hover { color: var(--text); gap: 10px; }

/* ------------------------------------------------------------- forms --- */
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.label { font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
legend.label { margin-bottom: 8px; }
.input, .select select, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); transition: border-color var(--t-fast), background var(--t-fast);
  appearance: none; -moz-appearance: textfield;
}
textarea.input { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; }
.input::placeholder { color: var(--text-3); }
.input:hover, .select select:hover { border-color: var(--line-2); }
.input:focus, .select select:focus { outline: none; border-color: var(--text-2); background: var(--card); }
.input::-webkit-outer-spin-button, .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.select { position: relative; }
.select select { padding-right: 38px; cursor: pointer; }
.select select:disabled { opacity: .5; cursor: not-allowed; }
.select .ic { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text-2); }
.select--inline select { height: 36px; background: transparent; border-color: transparent; font-weight: 700; padding-left: 4px; }
.select option { background: var(--bg-2); }
.field--icon { position: relative; display: block; }
.field--icon > .ic { position: absolute; left: 14px; top: 13px; color: var(--text-2); }
.field--icon .input { padding-left: 42px; }

.radio { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; color: var(--text-2); transition: color var(--t-fast); }
.radio:hover { color: var(--text); }
.radio input { appearance: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); margin: 0; flex: none; display: grid; place-items: center; transition: border-color var(--t-fast); }
.radio input::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; transform: scale(0); transition: transform var(--t-fast); }
.radio input:checked { border-color: #fff; }
.radio input:checked::after { transform: scale(1); }
.radio input:checked + span { color: var(--text); }
.radio span { display: inline-flex; align-items: center; gap: 6px; }
.radio .ic { width: 14px; height: 14px; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg__opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg__opt span { display: inline-flex; height: 34px; align-items: center; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; transition: all var(--t-fast); }
.seg__opt input:checked + span { background: #fff; color: #000; border-color: #fff; }
.seg__opt input:focus-visible + span { box-shadow: var(--focus); }

/* ---------------------------------------------------- chips & badges --- */
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: var(--r-pill); background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text-2); font-weight: 600; font-size: var(--fs-sm); white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.chip .ic { width: 16px; height: 16px; }
a.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.is-active { background: #fff; border-color: #fff; color: #000; }
.chip--static { height: 30px; padding: 0 12px; font-size: var(--fs-xs); }

.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: #fff; color: #000; font-size: 11px; font-weight: 800; }

/* Статус продавца */
.lvl { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--r-xs); font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--text-2); }
.lvl--verified { color: var(--text); border-color: var(--text-2); }
.lvl--pro { background: #fff; color: #000; border-color: #fff; }

.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--text-2); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #fff; position: relative; }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #fff; animation: pulse 2s var(--ease) infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(3); opacity: 0; } }

/* ------------------------------------------------------------- cards --- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.pad { padding: 24px; }

/* Аватар */
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, #2A2A30, #18181B); border: 1px solid var(--line-2); font-weight: 800; color: var(--text); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--xs { width: 22px; height: 22px; font-size: 10px; }
.avatar--sm { width: 32px; height: 32px; font-size: 13px; }
.avatar--md { width: 40px; height: 40px; font-size: 15px; }
.avatar--lg { width: 52px; height: 52px; font-size: 19px; }
.avatar--xl { width: 88px; height: 88px; font-size: 32px; font-family: var(--font-display); }

/* Звёзды */
.stars { display: inline-flex; gap: 1px; color: #fff; }
.stars .ic { width: 13px; height: 13px; stroke-width: 1.4; }
.stars--md .ic { width: 16px; height: 16px; }

/* Уведомления-плашки */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--line); color: var(--text-2); font-size: var(--fs-sm); margin-bottom: 16px; }
.notice .ic { margin-top: 2px; }
.notice--warn { border-color: rgba(253, 230, 138, .25); color: var(--warn); }

/* ---------------------------------------------------------- skeleton --- */
.skeleton { position: relative; overflow: hidden; background: var(--card-2); border-radius: var(--r-sm); }
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.05), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-line { height: 12px; margin-bottom: 10px; }
.sk-line--lg { height: 20px; width: 85%; }

/* ------------------------------------------------------------ toasts --- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md);
  background: rgba(26,26,29,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-2); box-shadow: 0 24px 48px -12px rgba(0,0,0,.7);
  animation: toast-in .35s var(--ease) both; font-size: var(--fs-sm);
}
.toast.is-leaving { animation: toast-out .25s var(--ease) both; }
.toast__icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--card-2); }
.toast--success .toast__icon { background: #fff; color: #000; }
.toast--error .toast__icon { color: var(--danger); }
.toast--warning .toast__icon { color: var(--warn); }
.toast__body { flex: 1; padding-top: 4px; }
.toast__close { color: var(--text-3); padding: 4px; }
.toast__close:hover { color: var(--text); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* --------------------------------------------------------- pager etc --- */
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 32px 0 8px; }
.pager__btn { min-width: 40px; height: 40px; display: inline-grid; place-items: center; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line); color: var(--text-2); font-weight: 700; transition: all var(--t-fast); }
.pager__btn:hover { color: var(--text); border-color: var(--line-2); }
.pager__btn.is-active { background: #fff; color: #000; border-color: #fff; }
.pager__gap { align-self: center; color: var(--text-3); padding: 0 4px; }

.empty { text-align: center; padding: 64px 16px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.empty__mark { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--card); color: var(--text-2); }

.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-pill); }
.tab { height: 38px; padding: 0 18px; border-radius: var(--r-pill); font-weight: 700; color: var(--text-2); transition: all var(--t-fast); display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--text); }
.tab.is-active { background: #fff; color: #000; }
.tab.is-active .muted { color: #555; }
.tabs--line { display: flex; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; margin: 28px 0 24px; gap: 8px; }
.tabs--line .tab { border-radius: 0; height: 46px; padding: 0 4px; margin-right: 16px; border-bottom: 2px solid transparent; }
.tabs--line .tab.is-active { background: none; color: var(--text); border-color: #fff; }

/* FAQ */
.faq { display: grid; gap: 10px; }
.faq__item { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); transition: border-color var(--t-fast); }
.faq__item:hover, .faq__item[open] { border-color: var(--line-2); }
.faq__item summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; font-weight: 700; }
.faq__icon { transition: transform var(--t); color: var(--text-2); }
.faq__item[open] .faq__icon { transform: rotate(45deg); color: var(--text); }
.faq__answer { padding: 0 20px 4px; color: var(--text-2); animation: fade-down .3s var(--ease); }
@keyframes fade-down { from { opacity: 0; transform: translateY(-6px); } }

/* Анимация появления блоков при прокрутке */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* Плавные переходы между страницами (Chromium 126+, остальные браузеры — обычная навигация) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .18s var(--ease) both vt-out; }
::view-transition-new(root) { animation: .28s var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------------------------------------------------- forms: states --- */
.input-wrap { position: relative; }
.input-wrap--pwd .input { padding-right: 46px; }
.input-wrap__eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; color: var(--text-3); border-radius: var(--r-sm); }
.input-wrap__eye:hover, .input-wrap__eye.is-on { color: var(--text); }
.has-error .input { border-color: rgba(252, 165, 165, .55); }
.error { margin: 0; color: var(--danger); font-size: var(--fs-sm); }
.hint { margin: 0; color: var(--text-3); font-size: var(--fs-sm); }
.label { text-transform: none; letter-spacing: 0; font-size: var(--fs-sm); }
.filters .label, legend.label { text-transform: uppercase; letter-spacing: .06em; }

.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; color: var(--text-2); font-size: var(--fs-sm); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check__box { width: 20px; height: 20px; flex: none; border-radius: 6px; border: 1.5px solid var(--line-2); display: grid; place-items: center; transition: all var(--t-fast); margin-top: 1px; }
.check__box .ic { width: 14px; height: 14px; stroke-width: 2.6; opacity: 0; transform: scale(.6); transition: all var(--t-fast); }
.check input:checked + .check__box { background: #fff; border-color: #fff; color: #000; }
.check input:checked + .check__box .ic { opacity: 1; transform: none; }
.check input:focus-visible + .check__box { box-shadow: var(--focus); }
.check a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* Индикатор надёжности пароля */
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.strength i { height: 4px; border-radius: 4px; background: var(--line); transition: background var(--t); }
.strength[data-level="1"] i:nth-child(-n+1), .strength[data-level="2"] i:nth-child(-n+2) { background: var(--text-3); }
.strength[data-level="3"] i:nth-child(-n+3) { background: var(--text-2); }
.strength[data-level="4"] i { background: #fff; }

/* CAPTCHA */
.captcha__row { display: grid; grid-template-columns: 220px 1fr; gap: 10px; align-items: stretch; }
.captcha__img { position: relative; height: 76px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: #141416; }
.captcha__img img { width: 220px; height: 76px; transition: opacity var(--t); }
.captcha__img.is-loading img { opacity: .25; }
.captcha__refresh { position: absolute; right: 6px; bottom: 6px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(11,11,13,.8); color: var(--text-2); border: 1px solid var(--line-2); }
.captcha__refresh:hover { color: #fff; }
.captcha__refresh .ic { width: 14px; height: 14px; }
.captcha__img.is-loading .captcha__refresh .ic { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.captcha__input { height: 76px; font: 700 24px var(--font-display); letter-spacing: .25em; text-transform: uppercase; text-align: center; }
.captcha__input::placeholder { font: 500 var(--fs-sm) var(--font); letter-spacing: 0; text-transform: none; }
@media (max-width: 480px) { .captcha__row { grid-template-columns: 1fr; } .captcha__img { width: 220px; } .captcha__input { height: 52px; } }
