/* FitGuru Mini App — тема Style DNA: светло, воздушно, серифные акценты.
   Цвета Telegram подмешиваются через --tg-* (см. applyTheme в app.js). */
:root {
  --bg: #faf9f7;
  --card: #ffffff;
  --ink: #1c1c1c;
  --muted: #8a8780;
  --line: #ece9e4;
  --accent: #1c1c1c;      /* акцент = глубокий графит, не кричащий */
  --accent-ink: #ffffff;
  --radius: 18px;
  --gap: 14px;
  --pad: 20px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overscroll-behavior-y: none;
}

.serif { font-family: Georgia, "Times New Roman", serif; }

#app { padding: 0 var(--pad) 120px; max-width: 620px; margin: 0 auto; }
.screen { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hidden { display: none !important; }

/* Заголовки экранов */
.eyebrow {
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin: 28px 0 8px;
}
h1.title {
  font-family: Georgia, serif; font-weight: 500; font-size: 27px;
  line-height: 1.2; margin: 0 0 10px;
}
p.lead { color: var(--muted); margin: 0 0 22px; font-size: 15px; }

/* Прогресс-бар */
.progress {
  position: sticky; top: 0; z-index: 10; background: var(--bg);
  padding: 14px var(--pad) 8px; display: flex; align-items: center; gap: 12px;
}
.progress-bar {
  flex: 1; height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; position: relative;
}
.progress-bar::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--pct, 0%); background: var(--accent); border-radius: 3px; transition: width .3s ease;
}
.progress-label { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Приветствие «кто мы» */
.hero { padding-top: 8px; }
.hero .title { font-size: 29px; margin-bottom: 14px; }
.bullets { list-style: none; padding: 0; margin: 26px 0 0; }
.bullets li {
  padding: 14px 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink);
}
.bullets li:last-child { border-bottom: 1px solid var(--line); }

/* Витрина-мудборды (реклама «что мы делаем») */
.showcase { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: 6px; }
.showcase-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--card); border: 1px solid var(--line); aspect-ratio: 4/5;
}
.showcase-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.showcase-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 12px;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 6px;
  background: linear-gradient(transparent, rgba(0,0,0,.6)); color: #fff;
}
.showcase-title { font-size: 14px; font-weight: 600; }
.showcase-price { font-size: 13px; opacity: .9; white-space: nowrap; }

/* Лента бордов (интро + выбор стиля) */
.board-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.board {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--card); border: 1px solid var(--line); aspect-ratio: 4/5;
  cursor: pointer; transition: transform .12s ease;
}
.board:active { transform: scale(.97); }
.board img { width: 100%; height: 100%; object-fit: cover; display: block; }
.board .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 22px 12px 10px; color: #fff; font-size: 13px; font-weight: 500;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
}
/* Отметка выбора (механика Indyx) */
.board .check {
  position: absolute; top: 10px; right: 10px; width: 26px; height: 26px;
  border-radius: 50%; background: rgba(255,255,255,.85); color: var(--ink);
  display: grid; place-items: center; font-size: 15px; opacity: 0; transform: scale(.6);
  transition: .15s ease;
}
.board.picked { border-color: var(--accent); }
.board.picked .check { opacity: 1; transform: none; background: var(--accent); color: #fff; }
.board.picked::after {
  content: ''; position: absolute; inset: 0; border: 2px solid var(--accent);
  border-radius: var(--radius); pointer-events: none;
}

/* Чипы (пол, поводы, размеры, стили) */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); font-size: 15px; cursor: pointer; transition: .12s ease;
}
.chip:active { transform: scale(.96); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Крупные карточки-опции (пол, фигура силуэтами) */
.options { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.opt {
  border: 1px solid var(--line); background: var(--card); border-radius: var(--radius);
  padding: 22px 16px; text-align: center; cursor: pointer; transition: .12s ease;
}
.opt:active { transform: scale(.97); }
.opt.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.opt .ico { font-size: 30px; display: block; margin-bottom: 8px; }
.opt .lbl { font-size: 15px; }

/* Три слова о стиле (результат выбора картинок) */
.words { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.word {
  font-family: Georgia, serif; font-size: 20px; padding: 8px 18px;
  border-radius: 999px; background: var(--card); border: 1px solid var(--line);
}

/* Цветотип-палитра */
.palette { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.swatch { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); }
.swatch.avoid { position: relative; }
.swatch.avoid::after {
  content: ''; position: absolute; left: 6px; right: 6px; top: 50%; height: 2px;
  background: #d23c3c; transform: rotate(-45deg);
}
/* Палитра с подписями (лучшие цвета) */
.palette-labeled { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 8px; margin: 14px 0; }
.sw-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sw-item .swatch { width: 100%; height: 62px; }
.sw-name { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.2; }
/* Рекомендации металл/принты */
.crows { margin: 18px 0 0; border-top: 1px solid var(--line); }
.crow { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.crow .ck { min-width: 76px; color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .1em; padding-top: 3px; }

/* Загрузка селфи */
.upload {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 40px 20px;
  text-align: center; color: var(--muted); cursor: pointer; background: var(--card);
}
.upload .big { font-size: 34px; display: block; margin-bottom: 10px; }

/* Нижняя панель */
.footer {
  position: fixed; left: 0; right: 0; bottom: 0; padding: 14px var(--pad) 22px;
  background: linear-gradient(transparent, var(--bg) 22%); display: flex; gap: 12px;
  align-items: center; max-width: 620px; margin: 0 auto;
}
.btn-primary {
  flex: 1; padding: 16px; border: 0; border-radius: 14px; background: var(--accent);
  color: var(--accent-ink); font-size: 16px; font-weight: 600; cursor: pointer;
}
.btn-primary:disabled { opacity: .4; }
.btn-text { background: none; border: 0; color: var(--muted); font-size: 15px; padding: 12px; cursor: pointer; }

/* Карточки подобранных луков (финал квиза) */
.look-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 18px;
}
.look-board { width: 100%; display: block; }
.look-comment { padding: 14px 16px 0; margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink); }
.look-items { padding: 12px 16px 4px; }
.look-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink);
  font-size: 14px;
}
.look-item:last-child { border-bottom: 0; }
.look-item:active { opacity: .6; }
.look-price { color: var(--muted); white-space: nowrap; }
.look-total { padding: 12px 16px 16px; font-size: 14px; color: var(--muted); }
.look-total b { color: var(--ink); font-size: 16px; }

/* Спиннер */
.spinner {
  width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; padding: 30px 0; }

/* Тёмная тема (Telegram сообщает через applyTheme) */
body.dark {
  --bg: #17171a; --card: #212126; --ink: #f2f0ec; --muted: #97948d;
  --line: #303036; --accent: #f2f0ec; --accent-ink: #17171a;
}
