/* Общие стили всех демо. Цвета берутся из темы Telegram, в браузере используются запасные значения. */
:root {
  --bg: var(--tg-theme-bg-color, #0e1319);
  --card: var(--tg-theme-secondary-bg-color, #171e27);
  --text: var(--tg-theme-text-color, #e8eef5);
  --muted: var(--tg-theme-hint-color, #8b99aa);
  --accent: var(--tg-theme-button-color, #3ddc97);
  --accent-text: var(--tg-theme-button-text-color, #06140e);
  --line: rgba(128, 140, 155, 0.25);
  --danger: #ff6b6b;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "SF Pro Text", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.app { max-width: 480px; margin: 0 auto; padding: 20px 16px 120px; }
[hidden] { display: none !important; }

/* Заголовок экрана */
.head { margin-bottom: 20px; }
.head h1 { font-size: 26px; line-height: 1.2; margin: 10px 0 6px; letter-spacing: -0.01em; }
.head p { color: var(--muted); }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 159, 90, 0.16);
  color: #ff9f5a;
}
.badge--ok { background: rgba(61, 220, 151, 0.16); color: #3ddc97; }

/* Форма */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 14px; color: var(--muted); }

.input {
  width: 100%;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  font: inherit;
  outline: none;
  resize: none;
  appearance: none;
}
.input:focus { border-color: var(--accent); }
.input.is-bad { border-color: var(--danger); }

/* Кнопки-«чипы» для выбора */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  padding: 9px 16px;
  border-radius: 999px;
}
.chip.is-active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.chip:disabled { opacity: 0.35; text-decoration: line-through; }

.error { color: var(--danger); font-size: 14px; }

.submit {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  border: 0;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 700;
  padding: 15px;
  border-radius: 12px;
}
.submit:active { opacity: 0.8; }

.ghost {
  width: 100%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  padding: 14px;
  border-radius: 12px;
}

/* Каталог товаров (цветы) */
.products { display: flex; flex-direction: column; gap: 10px; }
.product { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 16px; padding: 12px 14px; }
.product__icon { font-size: 34px; }
.product__main { flex: 1; min-width: 0; }
.product__name { font-weight: 700; }
.product__desc { color: var(--muted); font-size: 13px; }
.product__price { font-weight: 700; margin-top: 2px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 18px;
}
.stepper output { min-width: 16px; text-align: center; font-weight: 700; }

/* Нижняя панель с итогом */
.total {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.total__inner { max-width: 480px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.total__sum { font-size: 13px; color: var(--muted); }
.total__sum b { display: block; font-size: 20px; color: var(--text); }
.total .submit { width: auto; flex: 1; }

/* Сообщение, которое получает владелец */
.message {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  animation: pop 0.45s ease-out both;
}
.message__head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.message__bot { color: var(--accent); font-weight: 700; }
.message__title { font-weight: 700; margin-bottom: 8px; }
.message__list { list-style: none; font-size: 15px; margin-bottom: 12px; }
.message__list li { margin-bottom: 2px; }
.message__list span { color: var(--muted); }
.message__done { font-size: 14px; color: var(--accent); border-top: 1px solid var(--line); padding-top: 10px; }

.note { color: var(--muted); font-size: 13px; margin: 14px 2px 18px; }
.actions { display: flex; flex-direction: column; gap: 10px; }

@keyframes pop {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* Витрина со всеми демо */
.hub { display: flex; flex-direction: column; gap: 12px; }
.hub__card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  color: var(--text);
  text-decoration: none;
}
.hub__card:active { opacity: 0.8; }
.hub__icon { font-size: 34px; }
.hub__name { font-weight: 700; }
.hub__desc { color: var(--muted); font-size: 14px; }

/* Меню записи в салон: обложка, строки-входы, списки выбора */
.cover {
  height: 140px;
  margin: -20px -16px 0;
  background: radial-gradient(circle at 25% 30%, rgba(61, 220, 151, 0.35), transparent 55%),
              radial-gradient(circle at 80% 70%, rgba(255, 159, 90, 0.3), transparent 55%),
              var(--card);
  display: flex; align-items: flex-end; padding: 16px;
  font-size: 13px; color: var(--muted);
}
.menu { list-style: none; background: var(--card); border-radius: 16px; overflow: hidden; }
.menu__row {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  color: var(--text); font: inherit; text-align: left; padding: 14px 16px;
}
.menu__row:last-child { border-bottom: 0; }
.menu__icon { font-size: 22px; }
.menu__main { flex: 1; min-width: 0; }
.menu__title { font-weight: 600; }
.menu__value { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu__value.is-set { color: var(--accent); }
.menu__arrow { color: var(--muted); }

.back { background: transparent; border: 0; color: var(--accent); font: inherit; padding: 0 0 12px; }

.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--card); border: 1px solid transparent; border-radius: 14px;
  color: var(--text); font: inherit; text-align: left; padding: 12px 14px;
}
.pick.is-active { border-color: var(--accent); }
.pick__icon { font-size: 28px; }
.pick__main { flex: 1; min-width: 0; }
.pick__name { font-weight: 600; }
.pick__sub { color: var(--muted); font-size: 13px; }
.pick__side { font-weight: 700; white-space: nowrap; }
.pick__check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 13px; color: var(--accent-text); }
.pick.is-active .pick__check { background: var(--accent); border-color: var(--accent); }

/* Заголовок группы в длинном списке услуг */
.group { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; margin: 14px 4px 2px; }
.group:first-child { margin-top: 0; }

/* Вкладки-переключатель (например, маникюр и педикюр) */
.tabs {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--card); border-radius: 14px; padding: 4px;
  margin: 0 0 14px; box-shadow: 0 0 0 8px var(--bg);
}
.tab { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 11px 8px; border-radius: 11px; }
.tab.is-active { background: var(--accent); color: var(--accent-text); }
