/* === FORM.CSS ===
   /home/serverflow/web/fit.slim-studio.com/www/assets/css/form.css
   НАЗНАЧЕНИЕ: Стили SPA-анкеты Slim Studio
*/

:root {
  --cream:       oklch(97% 0.02 80);
  --gold:        oklch(78% 0.10 75);
  --gold-dark:   oklch(62% 0.12 70);
  --brown:       oklch(52% 0.08 55);
  --brown-light: oklch(88% 0.05 65);
  --white:       #ffffff;
  --text:        oklch(28% 0.04 55);
  --text-soft:   oklch(55% 0.04 60);
  --error:       oklch(55% 0.18 25);
  --radius:      14px;
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
}

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

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Progress bar ──────────────────────────────── */
.progress-wrap {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  padding: 14px 24px 10px;
  border-bottom: 1px solid color-mix(in oklch, var(--gold) 20%, transparent);
}

.progress-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}

.progress-logo {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700; font-size: 1rem;
  color: var(--brown); letter-spacing: 0.06em;
}

.progress-step {
  font-size: 0.78rem; color: var(--text-soft);
}

.progress-bar-track {
  height: 4px; border-radius: 4px;
  background: color-mix(in oklch, var(--gold) 20%, white);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
  transition: width 0.4s var(--ease-out);
  width: 0%;
}

/* ── Основной контейнер ────────────────────────── */
.form-wrap {
  max-width: 640px; margin: 0 auto;
  padding: 90px 24px 60px;
}

/* ── Экраны анкеты ─────────────────────────────── */
.screen {
  display: none;
  animation: fadeIn 0.35s var(--ease-out);
}

.screen.active { display: block; }

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

/* ── Заголовок экрана ──────────────────────────── */
.screen-tag {
  font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold-dark); margin-bottom: 8px;
}

.screen h2 {
  font-family: 'Quicksand', sans-serif;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700; color: var(--text);
  margin-bottom: 8px; line-height: 1.3;
}

.screen-sub {
  font-size: 0.9rem; color: var(--text-soft);
  margin-bottom: 28px;
}

/* ── Поля ввода ────────────────────────────────── */
.field { margin-bottom: 18px; }

.field label {
  display: block; font-size: 0.88rem;
  font-weight: 500; margin-bottom: 6px;
  color: var(--brown);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="date"],
.field input[type="number"] {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--brown-light);
  border-radius: var(--radius);
  font-family: inherit; font-size: 1rem;
  background: var(--white); color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus {
  border-color: var(--gold-dark);
}

.field.has-error input {
  border-color: var(--error);
}

.field-error {
  font-size: 0.78rem; color: var(--error);
  margin-top: 4px; display: none;
}

.field.has-error .field-error { display: block; }

/* ── Чекбоксы и радио ──────────────────────────── */
.options { display: flex; flex-direction: column; gap: 10px; }

.options.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.opt-label {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--white);
  border: 1.5px solid var(--brown-light);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  font-size: 0.92rem;
  user-select: none;
}

.opt-label:hover {
  border-color: var(--gold);
  background: color-mix(in oklch, var(--gold) 8%, white);
}

.opt-label input { display: none; }

.opt-label.selected {
  border-color: var(--gold-dark);
  background: color-mix(in oklch, var(--gold) 15%, white);
  color: var(--brown);
  font-weight: 500;
}

.opt-check {
  width: 20px; height: 20px; flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--brown-light);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}

.opt-label.selected .opt-check {
  background: var(--gold-dark); border-color: var(--gold-dark);
}

.opt-check::after {
  content: '✓'; color: white; font-size: 11px;
  opacity: 0; transition: opacity 0.15s;
}

.opt-label.selected .opt-check::after { opacity: 1; }

/* Квадратный чекбокс для multiple */
.opt-label.multi .opt-check { border-radius: 5px; }

/* ── Шкала (1-10) ──────────────────────────────── */
.scale-wrap { margin-top: 8px; }

.scale-btns {
  display: flex; gap: 6px; flex-wrap: wrap;
}

.scale-btn {
  width: 44px; height: 44px;
  border: 1.5px solid var(--brown-light);
  border-radius: 10px; background: var(--white);
  font-family: 'Quicksand', sans-serif;
  font-weight: 600; font-size: 0.95rem;
  color: var(--text-soft); cursor: pointer;
  transition: all 0.18s var(--ease-out);
}

.scale-btn:hover { border-color: var(--gold); color: var(--gold-dark); }

.scale-btn.selected {
  background: var(--gold-dark); border-color: var(--gold-dark);
  color: var(--white);
}

.scale-labels {
  display: flex; justify-content: space-between;
  font-size: 0.72rem; color: var(--text-soft);
  margin-top: 6px; padding: 0 2px;
}

/* ── Антропометрия — комбинированный блок ─────── */
.anthro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px; margin-bottom: 16px;
}

.needs-measure-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  background: color-mix(in oklch, var(--gold) 8%, white);
  border: 1.5px solid var(--brown-light);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s;
}

.needs-measure-row:has(input:checked) {
  border-color: var(--gold-dark);
}

.needs-measure-row input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px;
  accent-color: var(--gold-dark); cursor: pointer; flex-shrink: 0;
}

.needs-measure-text strong {
  display: block; font-size: 0.9rem;
  color: var(--brown); margin-bottom: 3px;
}

.needs-measure-text span {
  font-size: 0.8rem; color: var(--text-soft);
}

.anthro-fields { transition: opacity 0.25s, height 0.25s; }
.anthro-fields.hidden { opacity: 0.3; pointer-events: none; }

/* ── Согласие ──────────────────────────────────── */
.consent-block {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  background: var(--white);
  border: 1.5px solid var(--brown-light);
  border-radius: var(--radius);
  margin-bottom: 14px;
  cursor: pointer;
}

.consent-block input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px;
  accent-color: var(--gold-dark); flex-shrink: 0;
}

.consent-block p {
  font-size: 0.84rem; color: var(--text-soft); line-height: 1.5;
}

.consent-block a { color: var(--gold-dark); }

.consent-block.has-error { border-color: var(--error); }

/* ── TG-блок ───────────────────────────────────── */
.tg-block {
  display: flex; gap: 14px; align-items: center;
  padding: 18px 20px;
  background: var(--white);
  border: 1.5px solid var(--brown-light);
  border-radius: var(--radius);
  margin-bottom: 24px;
  text-decoration: none; color: inherit;
  transition: border-color 0.2s;
}

.tg-block:hover { border-color: var(--gold); }

.tg-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  display: flex; align-items: center; justify-content: center;
}

.tg-icon svg {
  width: 22px; height: 22px;
  stroke: white; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.tg-block-text strong { display: block; font-size: 0.95rem; color: var(--brown); }
.tg-block-text span   { font-size: 0.82rem; color: var(--text-soft); }

.tg-status {
  font-size: 0.8rem; padding: 4px 10px;
  border-radius: 20px;
  background: color-mix(in oklch, var(--gold) 15%, white);
  color: var(--gold-dark);
  margin-left: auto; flex-shrink: 0;
}

/* ── Кнопки навигации ──────────────────────────── */
.nav-btns {
  display: flex; gap: 12px; margin-top: 28px;
  align-items: center;
}

.btn-next {
  flex: 1;
  padding: 15px 28px;
  background: var(--gold-dark); color: var(--white);
  border: none; border-radius: 50px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700; font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  box-shadow: 0 6px 20px color-mix(in oklch, var(--gold-dark) 30%, transparent);
}

.btn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px color-mix(in oklch, var(--gold-dark) 40%, transparent);
}

.btn-next:disabled {
  opacity: 0.6; cursor: not-allowed; transform: none;
}

.btn-back {
  padding: 15px 20px;
  background: none; border: 1.5px solid var(--brown-light);
  border-radius: 50px; color: var(--text-soft);
  font-family: inherit; font-size: 0.9rem;
  cursor: pointer; transition: all 0.2s;
}

.btn-back:hover { border-color: var(--brown); color: var(--text); }

/* ── Экран результата ──────────────────────────── */
.result-card {
  background: var(--white);
  border-radius: 20px; padding: 36px 32px;
  border: 1px solid color-mix(in oklch, var(--gold) 25%, transparent);
  box-shadow: 0 12px 40px color-mix(in oklch, var(--gold) 12%, transparent);
}

.result-icon {
  text-align: center; margin-bottom: 24px;
}

.result-icon svg {
  width: 64px; height: 64px;
  display: inline-block;
}

.result-card h2 {
  font-family: 'Quicksand', sans-serif;
  font-size: 1.5rem; color: var(--brown);
  text-align: center; margin-bottom: 16px;
}

.result-card p {
  color: var(--text-soft); margin-bottom: 14px;
  font-size: 0.95rem; line-height: 1.7;
}

.result-cta {
  margin-top: 24px; padding: 20px;
  background: color-mix(in oklch, var(--gold) 12%, white);
  border-radius: var(--radius);
  border-left: 3px solid var(--gold-dark);
  font-size: 0.95rem; color: var(--brown);
  font-weight: 500;
}

/* ── Адаптив ───────────────────────────────────── */
@media (max-width: 500px) {
  .form-wrap { padding: 80px 16px 50px; }
  .options.grid { grid-template-columns: 1fr 1fr; }
  .scale-btn { width: 36px; height: 36px; font-size: 0.85rem; }
  .anthro-grid { grid-template-columns: 1fr 1fr; }
}
