/* ============================================================
   Анкета «Мини-курс» — дизайн в стиле мини-аппа
   ============================================================ */
:root {
  color-scheme: light;
  --bg: #fbfbfc;
  --fg: #353535;
  --accent: #353535;
  --accent-fg: #fbfbfc;
  --plate: #f0f0f0;
  --muted: rgba(53, 53, 53, 0.5);
  --muted2: rgba(53, 53, 53, 0.4);
  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --radius: 18px;
  --page-pad: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
*::-webkit-scrollbar { width: 0; height: 0; }

html, body {
  margin: 0;
  min-height: 100%;
}
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  outline: none;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

input, textarea {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  outline: none;
  font: inherit;
  color: var(--fg);
}

/* layout: центрируем колонку на десктопе, во всю ширину на телефоне */
.wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 16px) var(--page-pad) calc(var(--safe-bottom) + 16px);
}

/* верх: прогресс */
.top {
  flex: none;
  padding: 4px 2px 14px;
}
.top.is-hidden { display: none; }
.bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(53, 53, 53, 0.1);
  overflow: hidden;
}
.bar__fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.top__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.top__block { color: var(--muted); text-transform: uppercase; }
.top__count { color: var(--muted2); }

/* середина: сцена */
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: 8px 0;
}

/* анимация появления шага */
@keyframes inRight {
  from { opacity: 0; transform: translateX(34px); }
  to   { opacity: 1; transform: none; }
}
@keyframes inLeft {
  from { opacity: 0; transform: translateX(-34px); }
  to   { opacity: 1; transform: none; }
}
.anim-r { animation: inRight 0.34s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.anim-l { animation: inLeft 0.34s cubic-bezier(0.22, 0.61, 0.36, 1) both; }

/* ---- стартовый экран ---- */
.intro { text-align: left; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--plate);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 18px;
}
.chip::before { content: '✦'; color: #c9a9c6; }
.intro__title {
  margin: 0;
  font-size: 34px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.6px;
}
.intro__sub {
  margin: 10px 0 22px;
  font-size: 15px;
  color: var(--muted);
}
.intro__body {
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-line;
  color: rgba(53, 53, 53, 0.85);
}
.intro__hero {
  display: block;
  margin: 0 auto 24px;
  width: min(56vw, 220px);
  height: auto;
  object-fit: contain;
}

/* ---- вопрос ---- */
.q-block {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted2);
  margin-bottom: 12px;
}
.q-title {
  margin: 0 0 6px;
  font-size: 25px;
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.4px;
}
.q-hint {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.q-hint.is-solo { margin-top: 4px; }

/* поля ввода */
.field {
  width: 100%;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--plate);
  font-size: 16px;
  transition: box-shadow 0.15s ease, background 0.15s ease;
}
.field::placeholder { color: rgba(53, 53, 53, 0.33); }
.field:focus {
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}
textarea.field {
  min-height: 130px;
  resize: none;
  line-height: 1.5;
}

/* варианты ответа */
.opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 16px;
  border-radius: var(--radius);
  background: var(--plate);
  color: var(--fg);
  text-align: left;
  font-size: 15px;
  line-height: 1.35;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}
.opt:active { transform: scale(0.99); }
.opt__box {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(53, 53, 53, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}
.opt--radio .opt__box { border-radius: 50%; }
.opt__box svg { width: 13px; height: 13px; opacity: 0; transform: scale(0.6); transition: 0.15s ease; }
.opt.is-sel {
  background: var(--accent);
  color: var(--accent-fg);
}
.opt.is-sel .opt__box {
  background: var(--accent-fg);
  box-shadow: none;
}
.opt.is-sel .opt__box svg { opacity: 1; transform: none; color: var(--accent); }
.opt__txt { flex: 1; min-width: 0; }

.other-wrap { margin-top: 2px; }
.other-wrap.is-hidden { display: none; }

.q-error {
  margin-top: 12px;
  font-size: 13px;
  color: #d9534f;
  min-height: 16px;
}

/* низ: навигация */
.nav {
  flex: none;
  display: flex;
  gap: 12px;
  padding-top: 14px;
}
.nav.is-hidden { display: none; }
.btn {
  flex: 1;
  padding: 17px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: transform 0.12s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn--primary {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}
.btn--primary:disabled {
  opacity: 0.4;
  box-shadow: none;
  cursor: default;
  transform: none;
}
.btn--ghost {
  flex: 0 0 auto;
  padding: 17px 22px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  color: var(--fg);
}
.btn--wide { width: 100%; }

/* экран благодарности */
.done {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.done__orb {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #fbe0ea 0%, #f0d3e6 52%, #e7dcf3 100%);
  box-shadow: 0 20px 46px rgba(220, 170, 200, 0.34);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  animation: pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.done__orb svg { width: 44px; height: 44px; color: var(--accent); }
@keyframes pop {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: none; }
}
.done__title {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.done__text {
  margin: 0 0 26px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 380px;
}
.done__id {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted2);
}
.gift {
  width: 100%;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-fg);
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
  transition: transform 0.12s ease;
}
.gift:active { transform: scale(0.985); }
.gift__icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.gift__txt { flex: 1; min-width: 0; text-align: left; }
.gift__label { font-size: 15px; font-weight: 700; }
.gift__hint { font-size: 12px; opacity: 0.7; }

/* honeypot — скрыто от людей */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* загрузка отправки */
.sending {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 15px;
}
.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(53, 53, 53, 0.15);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* десктоп: чуть крупнее воздух */
@media (min-width: 720px) {
  .wrap { padding-top: 48px; padding-bottom: 32px; }
  .intro__title { font-size: 40px; }
  .q-title { font-size: 28px; }
}
