/* Палитра и приёмы взяты с лендинга (landing/index.html), чтобы сайт и
   мини-апп не выглядели двумя разными продуктами: тот же кремовый фон в
   точку, толстые контуры и плоские тени вместо размытых.

   Шрифты отдаются отсюда же (static/fonts), а не с fonts.googleapis.com:
   чужой CDN могут заблокировать, и вёрстка поедет сразу у всех. */

:root{
  --bg:#fdf6e9;
  --panel:#ffffff;
  --ink:#221b2e;
  --muted:#6b6178;
  --purple:#a24bf0;
  --green:#1fb97e;
  --blue:#2f8fe0;
  --pink:#ff4fa3;
  --line:rgba(34,27,46,0.12);
  --danger:#e5484d;

  /* Ширина колонки. Вёрстка родом из мини-аппа, где шире телефона ничего
     не бывает, и на мониторе те же 720px смотрелись напёрстком посреди
     пустоты. На большом экране колонку расширяем -- одним значением, а не
     правкой каждого блока. */
  --page:720px;
}

@media (min-width:1024px){
  :root{ --page:980px; }
}

*{ box-sizing:border-box; margin:0; padding:0; }

body{
  /* Прижимаем подвал к низу экрана: страниц на два блока хватает, и на
     мониторе подвал иначе висел в середине пустого поля. */
  display:flex; flex-direction:column;
  background:
    radial-gradient(circle at 2px 2px, rgba(34,27,46,0.06) 1.5px, transparent 1.5px) 0 0/22px 22px,
    var(--bg);
  color:var(--ink);
  font-family:'Baloo 2', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  min-height:100vh;
  min-height:100dvh;
  /* Мини-апп открывается вплотную к системной шторке -- запас снизу, чтобы
     кнопки не упирались в край экрана. */
  padding-bottom:32px;
}

a{ color:inherit; }

/* ------------------------------------------------------------ шапка */

.topbar{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:14px 20px;
  border-bottom:2.5px solid var(--ink);
  background:var(--panel);
  position:sticky; top:0; z-index:10;
}
.topbar .brand{
  font-weight:800; font-size:19px; text-decoration:none; letter-spacing:-0.2px;
}
.topbar .who{
  color:var(--ink); font-size:14px; font-weight:700; text-decoration:none;
  padding:7px 16px; border:2.5px solid var(--ink); border-radius:100px;
  background:var(--panel); box-shadow:3px 3px 0 var(--ink);
  transition:transform .12s ease, box-shadow .12s ease;
}
.topbar .who:hover{ transform:translate(-1px,-1px); box-shadow:4px 4px 0 var(--ink); }
.topbar .who:active{ transform:translate(1px,1px); box-shadow:2px 2px 0 var(--ink); }

.wrap{ width:100%; max-width:var(--page); margin:0 auto; padding:24px 20px; }

/* ------------------------------------------------------------ типографика */

.eyebrow{
  font-family:'Caveat', 'Segoe Script', 'Bradley Hand', cursive;
  font-size:23px; font-weight:700; color:var(--purple); margin-bottom:2px;
}
h1{ font-size:27px; font-weight:800; line-height:1.2; margin-bottom:10px; }
h2{ font-size:20px; font-weight:800; margin-bottom:14px; }
.lead{ color:var(--muted); font-size:16px; line-height:1.55; margin-bottom:26px; }
.hint{ color:var(--muted); font-size:14px; line-height:1.5; }

/* ------------------------------------------------------------ карточки */

.card{
  background:var(--panel);
  border:2.5px solid var(--ink);
  border-radius:22px;
  box-shadow:6px 6px 0 var(--ink);
  padding:24px;
}
.card + .card{ margin-top:18px; }

/* Витрина: сетка карточек -- значок крупно, под ним название. Двух
   колонок хватает на телефоне, дальше добавляем столбцы, а не растягиваем
   плитки на всю ширину. */
.shop-title{ font-size:24px; font-weight:800; margin-bottom:16px; }

/* Фильтр разделов. Обычные ссылки, без JS: работают и при отключённых
   скриптах, и ссылка на раздел остаётся ссылкой -- её можно переслать. */
.chips{
  display:flex; flex-wrap:wrap; gap:8px; margin-bottom:18px;
}
.chip{
  font-size:13px; font-weight:700; text-decoration:none; color:var(--ink);
  padding:8px 15px; border-radius:100px;
  background:var(--panel); border:2.5px solid var(--ink);
  box-shadow:3px 3px 0 var(--ink);
  transition:transform .12s ease, box-shadow .12s ease;
}
.chip:hover{ transform:translate(-1px,-1px); box-shadow:4px 4px 0 var(--ink); }
.chip:active{ transform:translate(1px,1px); box-shadow:2px 2px 0 var(--ink); }
.chip.is-active{ background:var(--ink); color:var(--panel); }

.tiles{ display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
@media (min-width:620px){ .tiles{ grid-template-columns:repeat(3,1fr); } }
@media (min-width:1024px){ .tiles{ grid-template-columns:repeat(4,1fr); } }

.tile{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:10px; text-align:center;
  min-height:132px; padding:18px 12px;
  background:var(--panel);
  border:2.5px solid var(--ink);
  border-radius:20px;
  box-shadow:5px 5px 0 var(--ink);
  text-decoration:none;
  transition:transform .12s ease, box-shadow .12s ease;
}
.tile:hover{ transform:translate(-2px,-2px); box-shadow:7px 7px 0 var(--ink); }
.tile:active{ transform:translate(1px,1px); box-shadow:3px 3px 0 var(--ink); }
.tile.is-soon{ opacity:.5; box-shadow:5px 5px 0 var(--line); border-color:var(--muted); }
.tile.is-soon:hover{ transform:none; box-shadow:5px 5px 0 var(--line); }

.tile-icon{
  width:54px; height:54px; flex:none;
  display:grid; place-items:center;
  font-size:28px; line-height:1;
  border:2.5px solid var(--ink);
  border-radius:16px;
  background:var(--bg);
}
.tile-title{ font-weight:800; font-size:14px; line-height:1.25; }
.tile-soon{
  font-size:11px; font-weight:700; color:var(--muted);
  text-transform:uppercase; letter-spacing:.05em;
}

/* ------------------------------------------------------------ кнопки */

.btn{
  font-family:inherit; font-weight:700; font-size:15px;
  padding:14px 26px; border-radius:100px;
  text-decoration:none; display:inline-block; text-align:center;
  color:var(--ink); background:var(--green);
  border:2.5px solid var(--ink);
  box-shadow:4px 4px 0 var(--ink);
  cursor:pointer;
  transition:transform .12s ease, box-shadow .12s ease;
}
.btn:hover{ transform:translate(-2px,-2px); box-shadow:6px 6px 0 var(--ink); }
.btn:active{ transform:translate(1px,1px); box-shadow:2px 2px 0 var(--ink); }
.btn-secondary{ background:var(--panel); }
.btn-wide{ display:block; width:100%; }
.btn:disabled{ opacity:.5; cursor:default; transform:none; box-shadow:4px 4px 0 var(--line); }

/* ------------------------------------------------------------ формы */

label{ display:block; font-weight:700; font-size:14px; margin-bottom:6px; }
input[type=text], input[type=email], input[type=password], input[type=number]{
  font-family:inherit; font-size:16px; color:var(--ink);
  width:100%; padding:13px 16px;
  background:var(--bg);
  border:2.5px solid var(--ink); border-radius:14px;
}
input:focus{ outline:none; border-color:var(--purple); }
.field + .field{ margin-top:16px; }
form .btn{ margin-top:20px; }

.error{
  background:#fff0f0; border:2.5px solid var(--danger); border-radius:14px;
  padding:12px 16px; color:var(--danger); font-weight:700; font-size:14px;
  margin-bottom:18px;
}
.notice{
  background:#f0fff8; border:2.5px solid var(--green); border-radius:14px;
  padding:12px 16px; font-weight:700; font-size:14px; margin-bottom:18px;
}

/* ------------------------------------------------------------ вход */

.login-box{ text-align:center; }
.login-box .tg-widget{ margin-top:20px; display:flex; justify-content:center; }
.alt-link{
  display:inline-block; margin-top:18px; color:var(--muted);
  font-size:14px; text-decoration:none; border-bottom:1.5px solid var(--line);
}
.alt-link:hover{ color:var(--ink); }

@media (max-width:420px){
  .card{ padding:20px; box-shadow:5px 5px 0 var(--ink); }
  h1{ font-size:23px; }
}

/* ------------------------------------------------------------ сводка заказа */

.summary{ margin-bottom:4px; }
.summary-row{
  display:flex; align-items:baseline; justify-content:space-between; gap:16px;
  padding:11px 0; border-bottom:1.5px dashed var(--line);
}
.summary-row span{ color:var(--muted); font-size:14px; }
.summary-row b{ font-size:16px; text-align:right; }
.summary-row:last-child{ border-bottom:none; }
.summary-total{ padding-top:14px; }
.summary-total span{ color:var(--ink); font-weight:700; font-size:16px; }
.summary-total b{ font-size:22px; }

/* Строка заказа в профиле -- кликабельная, ведёт на страницу заказа. */
.order-row{ text-decoration:none; }
.order-row:hover span{ color:var(--ink); }
.order-state{
  display:block; font-weight:700; font-size:12px; color:var(--muted);
  margin-top:2px;
}

/* ------------------------------------------------------------ навигация */

/* Кнопка назад слева, раздел справа -- симметрично, заголовок по центру
   не прыгает при появлении кнопок. */
.back-btn{
  flex:none;
  display:inline-flex; align-items:center; gap:5px;
  font-size:13px; font-weight:700; text-decoration:none; white-space:nowrap;
  padding:7px 14px;
  color:var(--ink); background:var(--panel);
  border:2.5px solid var(--ink); border-radius:100px;
  box-shadow:3px 3px 0 var(--ink);
  transition:transform .12s ease, box-shadow .12s ease;
}
.back-btn:hover{ transform:translate(-1px,-1px); box-shadow:4px 4px 0 var(--ink); }
.back-btn:active{ transform:translate(1px,1px); box-shadow:2px 2px 0 var(--ink); }
.back-spacer{ flex:none; width:24px; }

.topbar .who.is-current{ background:var(--bg); }

/* Выход: внизу, тусклый и без заливки -- случайно на него не нажмёшь. */
/* Выход -- в стиле сайта, но красный: сразу видно, что действие
   необратимое. От случайного нажатия защищает подтверждение, а не
   незаметность кнопки. */
.logout{ margin-top:26px; }
.logout-btn{
  font-family:inherit; font-size:14px; font-weight:700;
  display:block; width:100%; padding:13px 20px; cursor:pointer;
  color:var(--danger); background:var(--panel);
  border:2.5px solid var(--danger); border-radius:100px;
  box-shadow:4px 4px 0 var(--danger);
  transition:transform .12s ease, box-shadow .12s ease;
}
.logout-btn:hover{ transform:translate(-2px,-2px); box-shadow:6px 6px 0 var(--danger); }
.logout-btn:active{ transform:translate(1px,1px); box-shadow:2px 2px 0 var(--danger); }

/* ------------------------------------------------------------ промокод */

.promo-toggle{
  font-family:inherit; font-size:13.5px; font-weight:700; color:var(--muted);
  background:none; border:none; cursor:pointer;
  margin-top:16px; padding:4px 0;
  border-bottom:1.5px dashed var(--line);
}
.promo-toggle:hover{ color:var(--ink); border-bottom-color:var(--ink); }

.modal{
  border:2.5px solid var(--ink); border-radius:22px;
  box-shadow:8px 8px 0 var(--ink);
  background:var(--panel); color:var(--ink);
  padding:24px; max-width:340px; width:calc(100% - 40px);
}
.modal::backdrop{ background:rgba(34,27,46,.45); }
.modal h2{ margin-bottom:8px; }
.modal .btn{ margin-top:18px; }

/* ------------------------------------------------------------ каталог ваучеров */

.search{ display:flex; gap:8px; margin-bottom:18px; }
.search input{ flex:1; }
.search .btn{ margin-top:0; flex:none; padding:13px 20px; }

/* В плитке группы -- название и счётчик позиций, значка у них нет. */
.tile-count{
  font-size:12px; font-weight:700; color:var(--muted);
}

/* Позиции внутри группы -- списком: у них длинные названия и цена, в
   плитки такое не влезает. */
.list{ padding:6px 18px; }
.list-row{
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  padding:13px 0; text-decoration:none;
  border-bottom:1.5px dashed var(--line);
}
.list-row:last-child{ border-bottom:none; }
.list-row b{ font-size:15px; white-space:nowrap; }
.list-name{ display:block; font-weight:700; font-size:14px; line-height:1.3; }
.list-group{ display:block; font-size:12px; color:var(--muted); margin-top:2px; }
.list-row:hover .list-name{ color:var(--purple); }

/* Инструкция по активации приходит от foreignpay готовым текстом с
   переносами -- сохраняем их, иначе шаги слипаются в абзац. */
.instructions{ white-space:pre-line; }

/* ------------------------------------------------------------ список заказов */

h1 .count{
  font-size:15px; font-weight:700; color:var(--muted); vertical-align:middle;
}
.see-all{
  font-size:13px; font-weight:700; color:var(--purple);
  text-decoration:none; border-bottom:1.5px solid var(--line); margin-left:6px;
}
.see-all:hover{ border-bottom-color:var(--purple); }

.pager{
  display:flex; align-items:center; justify-content:center; gap:12px;
  margin-top:18px;
}
.pager-pos{ font-size:13px; font-weight:700; color:var(--muted); }

/* Цена до скидки -- зачёркнутой, скидка -- зелёной: человек должен видеть
   не только итог, но и что код сработал. */
.summary-row b.was{ color:var(--muted); text-decoration:line-through; font-weight:400; }
.summary-row b.saved{ color:var(--green); }
.promo-field{ margin-top:16px; }

/* Стрелки у числового поля не нужны: количество звёзд набирают с
   клавиатуры, а мышью щёлкать по 50 тысяч раз никто не станет. Плюс на
   телефоне они всё равно не показываются -- лишний элемент только на
   десктопе. */
input[type=number]{ -moz-appearance:textfield; appearance:textfield; }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }

/* ------------------------------------------------------------ документы */

/* Согласие -- рядом с кнопкой оплаты, а не в подвале: человек должен
   видеть его в момент, когда соглашается, иначе смысла в нём нет. */
.consent{
  margin-top:12px; font-size:12px; line-height:1.45; color:var(--muted); text-align:center;
}
.consent a{ color:var(--muted); text-decoration:underline; }
.consent a:hover{ color:var(--ink); }

.footer{
  display:flex; flex-wrap:wrap; justify-content:center; gap:16px;
  width:100%; max-width:var(--page); margin:auto auto 0; padding:34px 20px 18px;
  border-top:1.5px dashed var(--line);
}
.footer a{ font-size:12.5px; color:var(--muted); text-decoration:none; }
.footer a:hover{ color:var(--ink); text-decoration:underline; }

/* ------------------------------------------------------------ статистика */

.stat-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:12px; margin-bottom:18px; }
@media (min-width:1024px){ .stat-grid{ grid-template-columns:repeat(4,1fr); } }
.stat{
  background:var(--panel); border:2.5px solid var(--ink); border-radius:18px;
  box-shadow:4px 4px 0 var(--ink); padding:16px 14px; text-align:center;
}
.stat-num{ display:block; font-size:20px; font-weight:800; line-height:1.2; }
.stat-label{ display:block; font-size:12px; color:var(--muted); margin-top:4px; }
/* Ручной разбор -- единственная цифра, которая требует действия. */
.summary-row b.attention{ color:var(--danger); }

/* ------------------------------------------------------------ админка */

h2 .code{
  font-size:12px; font-weight:700; color:var(--muted);
  border:1.5px solid var(--line); border-radius:6px; padding:1px 6px; vertical-align:middle;
}
.field-row{ display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:16px; }
.field-row .field + .field{ margin-top:0; }

.switch{
  display:flex; align-items:center; gap:10px;
  margin-top:16px; font-weight:700; font-size:14px; cursor:pointer;
}
.switch input{ width:20px; height:20px; accent-color:var(--green); cursor:pointer; }

textarea{
  font-family:inherit; font-size:15px; color:var(--ink);
  width:100%; padding:13px 16px; resize:vertical;
  background:var(--bg); border:2.5px solid var(--ink); border-radius:14px;
}
textarea:focus{ outline:none; border-color:var(--purple); }

select{
  font-family:inherit; font-size:15px; color:var(--ink);
  width:100%; padding:13px 16px; cursor:pointer;
  background:var(--bg); border:2.5px solid var(--ink); border-radius:14px;
}
select:focus{ outline:none; border-color:var(--purple); }

/* Переключатель в строке списка -- компактнее обычной кнопки. */
.mini-btn{
  font-family:inherit; font-size:12px; font-weight:700; cursor:pointer;
  padding:6px 12px; border-radius:100px; white-space:nowrap;
  color:var(--muted); background:var(--panel);
  border:2px solid var(--line);
}
.mini-btn.on{ color:var(--ink); border-color:var(--green); background:#f0fff8; }
.summary-row form{ margin:0; }
.summary-row form .mini-btn{ margin-top:0; }

/* ------------------------------------------------------------ всплывашка */

.toast{
  position:fixed; left:50%; top:16px; z-index:100;
  transform:translate(-50%, -16px); opacity:0;
  max-width:min(420px, calc(100% - 32px));
  padding:13px 18px; text-align:center;
  font-size:14px; font-weight:700; line-height:1.4;
  color:var(--danger); background:#fff0f0;
  border:2.5px solid var(--danger); border-radius:16px;
  box-shadow:4px 4px 0 var(--danger);
  transition:transform .22s ease, opacity .22s ease;
}
.toast.is-shown{ transform:translate(-50%, 0); opacity:1; }
.toast.is-notice{
  color:var(--ink); background:#f0fff8;
  border-color:var(--green); box-shadow:4px 4px 0 var(--green);
}

.admin-links{ display:flex; flex-wrap:wrap; gap:8px; }

.badge-blocked{
  font-size:11px; font-weight:700; color:var(--danger);
  border:2px solid var(--danger); border-radius:100px; padding:2px 9px;
  vertical-align:middle; margin-left:6px;
}

/* ------------------------------------------------- премиум-эмодзи */

.emoji-row{ display:flex; align-items:center; gap:14px; margin-bottom:14px; }
/* Эмодзи крупно: по мелкому значку не отличить 🛠 от 🔧, а именно по нему
   админ и ищет нужную строку. */
.emoji-face{ font-size:30px; line-height:1; flex:0 0 auto; }
.emoji-where{ display:flex; flex-wrap:wrap; gap:6px; }
.emoji-chip{
  font-size:12.5px; font-weight:700; color:var(--muted);
  background:var(--bg); border:1.5px solid var(--line);
  border-radius:100px; padding:3px 10px;
}

.group-title{ font-size:16px; font-weight:800; margin:26px 0 12px; }
