/* ===== Токены ===== */
:root {
  --bg: #9c1220;
  --surface: #8a101c;
  --ink: #ffffff;
  --muted: #f3c4c8;
  --accent: #ffd9dc;
  --accent-ink: #8a0f1c;
  --field: #232323;
  --field-2: #2e2e2e;
  --field-ink: #ffffff;
  --field-muted: #c9c9c9;
  --line: rgba(255, 255, 255, .16);
  --danger: #ffb4a8;

  --f-display: 'Unbounded', 'Arial Black', system-ui, sans-serif;
  --f-text: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-giant: clamp(4.5rem, 9vw, 8.75rem);

  --gut: clamp(16px, 4vw, 56px);
  --max: 1440px;
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-text); font-size: var(--step-body); line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
h1, h2, h3 { margin: 0; font-weight: 800; }
.display { font-family: var(--f-display); font-weight: 800; text-transform: uppercase; letter-spacing: -0.03em; line-height: 1; }
.h-head { font-family: var(--f-display); font-weight: 800; text-transform: uppercase; letter-spacing: -0.03em; line-height: 1.02; font-size: var(--step-head); }
/* длинные слова в заголовках не выходят за рамки блока (0.7.8) */
h1, h2, h3, .h-head, .display, .step-name { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 480px) { :root { --step-head: clamp(1.5rem, 7.4vw, 2rem); } }
.lead { font-size: var(--step-lead); line-height: 1.35; max-width: 34ch; }
.muted { color: var(--muted); }
p { margin: 0; }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 2px solid transparent;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 1rem;
  text-decoration: none; cursor: pointer; transition: transform .2s var(--ease), background .2s;
}
.btn:hover { background: #fff; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--ink); border-color: currentColor; }
.btn.ghost:hover { background: rgba(255, 255, 255, .1); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: .9375rem; }
.btn.owned { background: transparent; color: var(--ink); border-color: var(--line); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-arrow { font-weight: 600; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
.link-arrow::after { content: '→'; transition: transform .2s var(--ease); }
.link-arrow:hover::after { transform: translateX(4px); }

/* ===== Шапка ===== */
.top { position: relative; z-index: 20; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 22px; padding-bottom: 22px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--f-display); font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em; font-size: 1.0625rem; }
.mark { width: 30px; height: 30px; flex: none; }
.nav { display: flex; gap: 28px; align-items: center; }
.nav a { text-decoration: none; font-size: 0.9375rem; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.nav .who { display: inline-flex; align-items: center; gap: 8px; }
.ava { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: .8125rem; }
.menu-btn { display: none; }
@media (max-width: 760px) {
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px var(--gut) 20px; background: var(--surface); }
  .nav.open { display: flex; }
  .nav a { padding: 10px 0; font-size: 1.0625rem; }
  .menu-btn { display: inline-flex; background: none; border: 2px solid var(--ink); border-radius: 999px; padding: 6px 14px; font-weight: 600; cursor: pointer; }
}

/* ===== Карточки ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 20px; }
.card { background: var(--field); color: var(--field-ink); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .3s var(--ease); }
.card:hover { transform: translateY(-4px); }
.card-stage { display: grid; place-items: center; padding: 34px 28px; background: var(--field-2); text-decoration: none; min-height: 230px; position: relative; }
.card-stage .wg { width: 100%; max-width: 300px; }
.card-stage .wg-small { max-width: 150px; }
.card-stage .wg-large { max-width: 220px; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.25; }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ''; position: absolute; inset: 0; }
.card { position: relative; }
.card-meta { color: var(--field-muted); font-size: .9375rem; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 12px; }
.price { font-weight: 700; font-size: 1.0625rem; }
.card-foot .btn { position: relative; z-index: 2; }
.tag-free { color: #9be7b0; }
.row-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.row-scroll > * { scroll-snap-align: start; }
@media (min-width: 1100px) { .row-scroll.fit { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); overflow: visible; } }

/* ===== Модальные окна и уведомления ===== */
dialog.modal { border: 0; padding: 0; border-radius: 20px; background: #fff; color: #1b1b1b; width: min(460px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(20, 0, 4, .6); }
.modal-in { padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.modal h2 { font-family: var(--f-display); text-transform: uppercase; font-size: 1.375rem; letter-spacing: -0.02em; line-height: 1.1; }
.modal p { color: #4a4a4a; font-size: 1rem; }
.modal .btn { background: var(--bg); color: #fff; }
.modal .btn:hover { background: var(--accent-ink); }
.modal .btn.ghost { background: transparent; color: #1b1b1b; border-color: #d3d3d3; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .9375rem; font-weight: 500; }
.field input, .field select, .field textarea { min-height: 46px; border-radius: 10px; border: 1.5px solid #cfcfcf; padding: 10px 14px; background: #fff; color: #1b1b1b; font-size: 1rem; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--bg); box-shadow: 0 0 0 3px rgba(156, 18, 32, .2); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: #111; color: #fff; padding: 14px 20px; border-radius: 14px; z-index: 100; display: flex; gap: 16px; align-items: center; transition: transform .35s var(--ease); max-width: calc(100vw - 32px); font-size: 1rem; }
.toast.show { transform: translate(-50%, 0); }
.toast a { color: var(--accent); font-weight: 600; }

/* ===== Подвал ===== */
/* Подвал: 4 колонки (магазин, разделы, документы, контакты) + строка о правах */
.foot { padding: 16vh 0 32px; font-size: .9375rem; }
.foot-cols { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr 1.2fr; gap: 32px 40px; padding-top: 32px; border-top: 1px solid var(--line); }
.foot-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.foot-col h2 { font-size: .8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.foot-col p { margin: 0; color: var(--muted); max-width: 32ch; }
.foot-col a { text-decoration: none; overflow-wrap: anywhere; }
.foot-col a:hover { text-decoration: underline; }
.foot-brand .brand { margin-bottom: 4px; }
.foot-req { font-size: .8125rem; line-height: 1.5; margin-top: 6px !important; }
.foot-gap { color: var(--muted); font-style: italic; }
.foot-note { margin: 36px 0 0; font-size: .8125rem; line-height: 1.5; color: var(--muted); max-width: 110ch; }
@media (max-width: 960px) { .foot-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-cols { grid-template-columns: 1fr; gap: 28px; } .foot-col a { padding: 4px 0; } }
/* Строка про оферту в окне оплаты */
.modal .legal-accept { font-size: .8125rem; line-height: 1.45; color: #666; margin-top: 4px; }
.modal .legal-accept a { color: inherit; }

/* ===== Появление ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}


/* ===== вход, регистрация, сброс пароля ===== */
.auth { display: flex; flex-direction: column; gap: 14px; }
.auth-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, .08); align-self: flex-start; }
.auth-tabs button { border: 0; background: transparent; color: inherit; font: inherit; font-weight: 600; font-size: .9375rem; padding: 8px 18px; border-radius: 999px; cursor: pointer; }
.auth-tabs button[aria-selected="true"] { background: #fff; color: #1b1b1b; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); cursor: default; }
.auth-h { font-family: var(--f-display); text-transform: uppercase; letter-spacing: -0.02em; font-size: 1.125rem; line-height: 1.15; }
.auth-lead { font-size: .9375rem; opacity: .85; }
.auth-link { align-self: flex-start; border: 0; background: none; padding: 2px 0; color: inherit; font: inherit; font-size: .9375rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.auth-hint { font-weight: 400; font-size: .8125rem; opacity: .75; }
.auth-err { display: none; margin: 0; padding: 10px 14px; border-radius: 10px; background: #ffe3e0; color: #8a0f1c; font-size: .9375rem; font-weight: 500; }
.auth-err.show { display: block; }
.pass-wrap { position: relative; display: block; }
.pass-wrap input { width: 100%; padding-right: 96px; }
.pass-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #6b6b6b; font: inherit; font-size: .8125rem; font-weight: 600; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.pass-eye:hover { color: #1b1b1b; background: #f1f1f1; }
.auth .btn[disabled] { opacity: .6; cursor: wait; }
/* на карминовом фоне кабинета */
.acc-login .auth-tabs { background: rgba(0, 0, 0, .22); }
.acc-login .auth-tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.acc-login .btn.ghost { color: var(--ink); }
.acc-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.acc-warn { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; background: var(--accent); color: var(--accent-ink); padding: 16px 20px; border-radius: 14px; margin: -24px 0 32px; font-size: 1rem; }
.acc-warn .btn { background: var(--accent-ink); color: #fff; }
