/* ==========================================================================
   Лёгкость — квиз (app.html): прогресс, шаги, варианты, экран результата.
   ========================================================================== */

.quiz-page {
  padding: 10px 0 36px;
  background: radial-gradient(900px 420px at 78% -220px, #ffeed6 0%, rgba(255, 238, 214, 0) 62%);
}

.quiz-wrap {
  max-width: 820px;
}

.quiz-head {
  padding: 10px 2px 18px;
}

.quiz-title {
  font-size: 25px;
  line-height: 1.14;
  letter-spacing: -0.8px;
  font-weight: 900;
}

.quiz-sub {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--muted);
}

.quiz-card {
  position: relative;
  background: #fff;
  border: 1.5px solid var(--card-line);
  border-radius: 24px;
  padding: 20px 16px 18px;
  box-shadow: var(--shadow-soft);
}

/* --------------------------------------------------------------------------
   Прогресс
   -------------------------------------------------------------------------- */

.progress {
  display: grid;
  gap: 9px;
}

.progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.progress-name {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
}

.progress-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pips {
  display: flex;
  gap: 4px;
}

.pip {
  height: 7px;
  flex: 1;
  border-radius: 999px;
  background: var(--line);
  transition: background-color 0.25s ease;
}

.pip.done {
  background: linear-gradient(90deg, #ffc56f, #ff8a5c);
}

/* --------------------------------------------------------------------------
   Шаги
   -------------------------------------------------------------------------- */

.step {
  padding-top: 22px;
}

.step[hidden] {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .step {
    animation: step-in 0.22s ease both;
  }
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.step-title {
  font-size: 24px;
  line-height: 1.16;
  letter-spacing: -0.7px;
  font-weight: 900;
  scroll-margin-top: 96px;
}

.step-sub {
  margin-top: 8px;
  margin-bottom: 22px;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--muted);
}

.field {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.field + .field {
  margin-top: 24px;
}

.field-k {
  padding: 0;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.1px;
  color: var(--ink);
}

.field.is-invalid .opt-grid,
.field.is-invalid .chip-row {
  border-radius: 18px;
  box-shadow: 0 0 0 3px rgba(217, 83, 31, 0.12);
}

.field.is-invalid .opt,
.field.is-invalid .choice,
.field.is-invalid .chip {
  border-color: #e9a98f;
}

/* --------------------------------------------------------------------------
   Шаг 1 — количество человек
   -------------------------------------------------------------------------- */

.people-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.seg {
  position: relative;
  display: block;
  cursor: pointer;
}

.seg input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.seg span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 58px;
  border: 1.5px solid var(--card-line);
  border-radius: 14px;
  background: #fff;
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.seg:hover span {
  border-color: #f0c9a6;
}

.seg:has(input:checked) span {
  border-color: transparent;
  background: linear-gradient(135deg, #ffc56f, #ff8a5c);
  box-shadow: 0 8px 18px rgba(255, 138, 92, 0.24);
}

.seg:has(input:focus-visible) span {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.people-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Шаг 2 — бюджет
   -------------------------------------------------------------------------- */

.budget-card {
  background: var(--warm);
  border: 1.5px solid var(--warm-line);
  border-radius: 18px;
  padding: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.budget-card.is-invalid {
  border-color: #e9a98f;
  box-shadow: 0 0 0 3px rgba(217, 83, 31, 0.12);
}

.budget-k {
  margin-bottom: 8px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
}

.budget-row {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  max-width: 100%;
  padding-bottom: 3px;
  border-bottom: 2px solid rgba(210, 170, 130, 0.38);
}

.budget-input {
  flex: 0 0 auto;
  width: 5ch;
  min-width: 4ch;
  border: 0;
  padding: 0;
  background: transparent;
  font-size: 38px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -1.6px;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.budget-input::-webkit-outer-spin-button,
.budget-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.budget-input:focus {
  outline: none;
}

.budget-row:focus-within {
  border-bottom-color: #ff8a5c;
}

.budget-cur {
  font-size: 24px;
  font-weight: 900;
  color: var(--accent);
}

.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  margin: 18px 0 0;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #ffb35c 0%,
    #ff8a5c var(--fill, 23%),
    #f4ede2 var(--fill, 23%),
    #f4ede2 100%
  );
  outline-offset: 8px;
  cursor: pointer;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border: 7px solid #ff9a63;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(200, 110, 60, 0.3);
}

.range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 7px solid #ff9a63;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(200, 110, 60, 0.3);
}

.range::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: transparent;
}

.range-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.preset {
  padding: 8px 12px;
  border: 1.5px solid rgba(210, 170, 130, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.preset:hover {
  background: #fff;
  border-color: #e9bd96;
}

.preset.is-active,
.preset.is-active:hover {
  background: linear-gradient(135deg, #ffc56f, #ff8a5c);
  border-color: transparent;
  color: #231c15;
  box-shadow: 0 4px 10px rgba(255, 138, 92, 0.22);
}

/* --------------------------------------------------------------------------
   Шаг 3 — магазин
   -------------------------------------------------------------------------- */

.store-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.store {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1.5px solid var(--card-line);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.store input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.store-logo {
  display: block;
  flex: none;
  width: 38px;
  height: 38px;
}

.store-logo img {
  width: 38px;
  height: 38px;
  max-width: none;
  border-radius: 10px;
  background: #fff;
}

.store-n {
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store:has(input:checked) {
  border-color: #ff8a5c;
  background: #fff8ee;
  box-shadow: 0 2px 10px rgba(255, 138, 92, 0.13);
}

.store-check {
  display: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffc56f, #ff8a5c);
  position: relative;
  flex: none;
}

.store-check::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  width: 5px;
  height: 9px;
  border-right: 2.5px solid #231c15;
  border-bottom: 2.5px solid #231c15;
  transform: rotate(45deg);
}

.store:has(input:checked) .store-check {
  display: block;
}

.store:has(input:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.store.is-soon {
  cursor: default;
  border-style: dashed;
  background: #fdf9f2;
  color: var(--muted);
}

.store.is-soon .store-logo img {
  filter: grayscale(0.75);
  opacity: 0.55;
}

.store.is-soon .store-n {
  color: var(--muted);
  font-weight: 700;
}

.store-badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: #f4ede2;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Шаги 4 и 7 — карточки-опции
   -------------------------------------------------------------------------- */

.opt-grid {
  display: grid;
  gap: 10px;
}

.opt {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 2px 12px;
  padding: 14px;
  border: 1.5px solid var(--card-line);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.opt input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.opt-mark {
  position: relative;
  grid-row: 1 / span 2;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 1.5px solid #d9cdbc;
  border-radius: 7px;
  background: #fff;
}

.opt b {
  display: block;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.opt small {
  display: block;
  font-size: 12.5px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--muted);
}

.opt:has(input:checked) {
  border-color: #ff8a5c;
  background: #fff8ee;
}

.opt:has(input:checked) .opt-mark {
  border-color: transparent;
  background: linear-gradient(135deg, #ffc56f, #ff8a5c);
}

.opt:has(input:checked) .opt-mark::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 4px;
  width: 6px;
  height: 10px;
  border-right: 2.5px solid #231c15;
  border-bottom: 2.5px solid #231c15;
  transform: rotate(45deg);
}

.opt:has(input:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

/* Радио-карточки (время на готовку) */

.choice-list {
  display: grid;
  gap: 10px;
}

.choice {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px 12px;
  padding: 13px 14px;
  border: 1.5px solid var(--card-line);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice-mark {
  position: relative;
  grid-row: 1 / span 2;
  width: 20px;
  height: 20px;
  border: 1.5px solid #d9cdbc;
  border-radius: 50%;
  background: #fff;
}

.choice b {
  display: block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.choice small {
  display: block;
  font-size: 12.5px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--muted);
}

.choice:has(input:checked) {
  border-color: #ff8a5c;
  background: #fff8ee;
}

.choice:has(input:checked) .choice-mark {
  border: 6px solid #ff9a63;
  background: #fff;
}

.choice:has(input:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Шаги 5 и 6 — чипсы
   -------------------------------------------------------------------------- */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px 10px 11px;
  border: 1.5px solid var(--card-line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 600;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.chip-mark {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1.5px solid #d9cdbc;
  border-radius: 6px;
  background: #fff;
  flex: none;
}

.chip:has(input:checked) {
  border-color: #ff8a5c;
  background: var(--warm);
}

.chip:has(input:checked) .chip-mark {
  border-color: transparent;
  background: linear-gradient(135deg, #ffc56f, #ff8a5c);
}

.chip:has(input:checked) .chip-mark::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border-right: 2px solid #231c15;
  border-bottom: 2px solid #231c15;
  transform: rotate(45deg);
}

.chip:has(input:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.chip-note {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Навигация по шагам
   -------------------------------------------------------------------------- */

.quiz-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1.5px solid var(--line);
}

.quiz-actions .btn-back {
  flex: none;
  min-width: 92px;
  padding-left: 14px;
  padding-right: 16px;
}

.quiz-actions .btn-back .arr {
  width: 8px;
  height: 8px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
}

.quiz-actions .btn-next {
  flex: 1;
  max-width: 330px;
  margin-left: auto;
}

.quiz-actions .btn-next.is-blocked,
.quiz-actions .btn-next.is-blocked:hover {
  background: #f3e7d8;
  color: #6c5b4a;
  box-shadow: none;
  transform: none;
}

.quiz-actions .btn-next.is-blocked .chev {
  border-color: #8a7661;
}

.quiz-footnote {
  margin-top: 16px;
  text-align: center;
  font-size: 12.5px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--muted);
}


/* --------------------------------------------------------------------------
   Брейкпоинты
   -------------------------------------------------------------------------- */

@media (min-width: 560px) {
  .opt-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .opt-grid.cols-1 {
    grid-template-columns: 1fr;
  }

  .store-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .quiz-page {
    padding: 34px 0 64px;
  }

  .quiz-head {
    padding: 6px 4px 22px;
  }

  .quiz-title {
    font-size: 32px;
    letter-spacing: -1.1px;
  }

  .quiz-sub {
    font-size: 15px;
  }

  .quiz-card {
    border-radius: 30px;
    padding: 28px 36px 28px;
  }

  .step {
    padding-top: 26px;
  }

  .step-title {
    font-size: 29px;
    letter-spacing: -1px;
  }

  .step-sub {
    font-size: 16px;
    margin-bottom: 26px;
  }

  .budget-input {
    font-size: 46px;
  }

  .budget-card {
    padding: 20px;
  }

  .seg span {
    height: 64px;
    font-size: 20px;
  }

  .quiz-actions {
    margin-top: 30px;
  }
}
