/*
  Дизайн-система сайта.
  Тема: авто (светлая и тёмная по настройке системы), один акцент на всю страницу.
  Скругления: поверхности 16px, элементы управления 12px. Других радиусов нет.
  Движение: только transform, opacity и цвет рамки; отключается при prefers-reduced-motion.
*/

@font-face {
  font-family: "Onest";
  src: url("/fonts/onest-cyrillic.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  src: url("/fonts/onest-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215;
}

:root {
  color-scheme: light dark;

  --bg: #f4f5f7;
  --surface: #fcfcfd;
  --surface-2: #eef0f3;
  --border: #d9dde4;
  --border-strong: #b4bac5;
  --text: #15171b;
  --muted: #555d6b;
  --accent: #f0b232;       /* золото UC: фон главной кнопки и рамка выбранного пака */
  --accent-ink: #1c1400;   /* текст на акцентном фоне */
  --accent-text: #855600;  /* акцент как цвет текста на светлом фоне */
  --ok: #0c7347;
  --err: #b3212d;
  --shadow: 0 1px 2px rgba(21, 23, 27, .05), 0 8px 24px rgba(21, 23, 27, .06);

  --r-surface: 16px;
  --r-control: 12px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e11;
    --surface: #15171c;
    --surface-2: #1c1f26;
    --border: #2a2e38;
    --border-strong: #454b59;
    --text: #eceef2;
    --muted: #a0a7b4;
    --accent-text: #f0b232;
    --ok: #4fd19a;
    --err: #ff8590;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Onest", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px 72px; }

/* Шапка */
.top { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: inline-flex; align-items: center; font-weight: 800; font-size: 20px; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.logo img { width: 28px; height: 28px; flex: none; margin-right: 8px; }
.logo span { color: var(--accent-text); }
.notice-chip {
  font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: var(--r-control);
  border: 1px solid var(--border); color: var(--muted); background: var(--surface);
}

/* Заголовок страницы */
.intro { padding: 28px 0 28px; max-width: 34rem; }
h1 { font-size: clamp(28px, 4.2vw, 40px); line-height: 1.1; letter-spacing: -.03em; font-weight: 700; margin: 0 0 10px; }
.lead { color: var(--muted); margin: 0; font-size: 17px; }

/* Две колонки: выбор слева, заказ справа */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }

h2 { font-size: 15px; font-weight: 600; color: var(--muted); margin: 0 0 12px; }

/* Разделы каталога */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tab {
  min-height: 44px; padding: 0 16px; border-radius: var(--r-control); border: 1px solid transparent;
  background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--surface); border-color: var(--border); color: var(--text); }

.tier-note { margin: -6px 0 16px; font-size: 14px; color: var(--muted); max-width: 34rem; }

/* Паки */
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pack {
  min-height: 84px; padding: 14px 16px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-control);
  color: var(--text); font: inherit;
  transition: border-color .15s var(--ease), transform .15s var(--ease);
}
.pack:hover { border-color: var(--border-strong); }
.pack:active { transform: scale(.98); }
.pack[aria-checked="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pack .name { display: block; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.pack .price { display: block; margin-top: 4px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pack[aria-checked="true"] .price { color: var(--accent-text); font-weight: 600; }

.pack.skeleton { cursor: default; pointer-events: none; border-color: transparent; background: var(--surface-2); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

.empty { color: var(--muted); margin: 0; padding: 20px 0; }
.empty.err { color: var(--err); }

/* Панель заказа */
.order {
  position: sticky; top: 20px; padding: 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-surface); box-shadow: var(--shadow);
}
.order h2 { color: var(--text); font-size: 18px; font-weight: 700; margin-bottom: 20px; letter-spacing: -.01em; }

label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.field { display: flex; gap: 8px; }
input[type="text"] {
  flex: 1; min-width: 0; height: 48px; padding: 0 14px;
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--r-control);
  color: var(--text); font: inherit; font-variant-numeric: tabular-nums;
  transition: border-color .15s var(--ease);
}
input[type="text"]::placeholder { color: var(--muted); opacity: 1; }
input[type="text"][aria-invalid="true"] { border-color: var(--err); }

.btn {
  min-height: 48px; padding: 0 18px; border-radius: var(--r-control); border: 1px solid transparent;
  font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  background: var(--accent); color: var(--accent-ink);
  transition: transform .15s var(--ease), opacity .15s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn.wide { width: 100%; min-height: 54px; font-size: 17px; }

.hint { font-size: 14px; margin: 8px 0 0; min-height: 21px; color: var(--muted); }
.hint.ok { color: var(--ok); }
.hint.err { color: var(--err); }

.rows { margin: 20px 0 0; padding: 0; }
.rows div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; }
.rows dt { color: var(--muted); }
.rows dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }

.total { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.total span:first-child { color: var(--muted); }
.total strong { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* Страницы заказа и оплаты */
.narrow { max-width: 520px; margin: 32px auto 0; }
.card { padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-surface); box-shadow: var(--shadow); }
.status { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }
.status-note { color: var(--muted); margin: 8px 0 0; }
.card .rows { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--border); }
.actions { margin: 24px 0 0; }

footer { color: var(--muted); font-size: 13px; margin-top: 48px; max-width: 34rem; }

@media (max-width: 899px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .order { position: static; }
  .intro { padding: 16px 0 24px; }
  .wrap { padding: 0 16px 56px; }
  .packs { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
