/* Поэтапная форма заявки (квиз) в окне #callBackModal */

.quiz {
  padding: 24px 32px 28px;
}

.quiz [hidden] {
  display: none !important;
}

.quiz__head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 28px;
  margin-right: 28px;
}

.quiz__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: none;
  color: #828282;
  font-size: 14px;
  transition: color 0.25s ease;
}

.quiz__back svg {
  width: 16px;
  height: 16px;
}

.quiz__back:hover,
.quiz__back:focus {
  color: #40ae49;
  outline: none;
}

.quiz__progress {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #eef0f2;
  overflow: hidden;
}

.quiz__progress-bar {
  width: 8%;
  height: 100%;
  border-radius: 2px;
  background: #40ae49;
  transition: width 0.35s ease;
}

.quiz__counter {
  font-size: 12px;
  color: #828282;
  white-space: nowrap;
}

.quiz__title {
  margin-top: 18px;
  text-align: center;
  font-size: 23px;
  line-height: 1.3;
}

.quiz__title::after {
  content: '';
  display: block;
  width: 50px;
  height: 2px;
  margin: 6px auto 0;
  background: #40ae49;
}

.quiz__desc {
  max-width: 460px;
  margin: 8px auto 0;
  text-align: center;
  font-size: 13px;
  color: #828282;
}

.quiz__body {
  margin-top: 22px;
}

.quiz__body > * {
  animation: qz-in 0.25s ease both;
}

@keyframes qz-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* Плитки выбора с фото */
.qz-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.qz-tile {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  background: #fff;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.qz-tile:hover {
  border-color: #40ae49;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.qz-tile:focus {
  outline: none;
}

.qz-tile:focus-visible,
.qz-tile.is-selected {
  border-color: #40ae49;
  box-shadow: 0 0 0 3px rgba(64, 174, 73, 0.35);
}

/* Галерея как в карточках Ozon: кадр выбирается положением курсора */
.qz-gal {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #f2f2f2;
  overflow: hidden;
}

.qz-gal__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  user-select: none;
}

.qz-gal__img.is-active {
  opacity: 1;
}

.qz-gal--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(64, 174, 73, 0.08);
  color: #40ae49;
}

.qz-tile--secondary .qz-gal--icon {
  background: #f5f5f5;
  color: #828282;
}

.qz-gal__dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  height: 18px;
  padding-top: 8px;
}

.qz-gal__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d6d6d6;
  transition: background-color 0.2s ease;
}

.qz-gal__dot.is-active {
  background: #40ae49;
}

.qz-tile__label {
  padding: 4px 12px 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: #1a1a1a;
}

.qz-tile__hint {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  color: #828282;
}

/* Количество */
.qz-counts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
}

.qz-count {
  height: 64px;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  background: #fff;
  font-size: 20px;
  font-weight: 500;
  color: #1a1a1a;
  transition: border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.qz-count:hover,
.qz-count.is-selected {
  border-color: #40ae49;
  color: #40ae49;
}

.qz-count:focus {
  outline: none;
}

.qz-count:focus-visible {
  box-shadow: 0 0 0 3px rgba(64, 174, 73, 0.35);
}

.qz-count--secondary {
  grid-column: 1 / -1;
  height: 48px;
  border-color: transparent;
  background: #f5f5f5;
  font-size: 14px;
  color: #828282;
}

/* Свой вариант и свободный ввод */
.qz-other {
  display: flex;
  gap: 10px;
  max-width: 520px;
  margin: 16px auto 0;
}

.qz-other .form-control {
  flex: 1;
}

.qz-other .green-btn,
.qz-free .green-btn {
  min-height: 44px;
  padding: 2px 28px;
}

.quiz .green-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.qz-free {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 420px;
  margin: 0 auto;
}

/* Ползунок площади */
.qz-range {
  padding-top: 4px;
}

.qz-range__value {
  min-height: 40px;
  margin-bottom: 14px;
  text-align: center;
  font-size: 18px;
  color: #1a1a1a;
}

.qz-range__value b {
  font-size: 32px;
  font-weight: 600;
  color: #40ae49;
}

.qz-range__hint {
  display: inline-block;
  padding-top: 8px;
  font-size: 14px;
  color: #828282;
}

.qz-range__input {
  --p: 0%;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.qz-range__input:focus {
  outline: none;
}

.qz-range__input::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #40ae49 var(--p), #e8e8e8 var(--p));
}

.qz-range__input::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: #e8e8e8;
}

.qz-range__input::-moz-range-progress {
  height: 6px;
  border-radius: 3px;
  background: #40ae49;
}

.qz-range__input::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  margin-top: -9px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #40ae49;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: box-shadow 0.25s ease;
  -webkit-appearance: none;
  appearance: none;
}

.qz-range__input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #40ae49;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.qz-range__input:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(64, 174, 73, 0.3);
}

.qz-range__input:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px rgba(64, 174, 73, 0.3);
}

.qz-range__scale {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 12px;
  color: #a0a0a0;
}

.qz-link {
  display: block;
  margin: 16px auto 0;
  padding: 0;
  border: none;
  background: none;
  font-size: 13px;
  color: #828282;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  transition: color 0.25s ease;
}

.qz-link:hover,
.qz-link:focus {
  color: #40ae49;
  outline: none;
}

.qz-free .qz-link {
  margin-top: 0;
}

/* Контакты */
.quiz__contacts {
  max-width: 360px;
  margin: 22px auto 0;
  animation: qz-in 0.25s ease both;
}

.quiz__error {
  margin-top: 4px;
  font-size: 12px;
  color: #d9534f;
}

.quiz__note {
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
  color: #a0a0a0;
}

/* Готово */
.qz-done {
  text-align: center;
}

.qz-done__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 4px auto 22px;
  border-radius: 50%;
  background: rgba(64, 174, 73, 0.12);
  color: #40ae49;
}

.qz-done .green-btn {
  display: inline-flex;
  padding: 2px 48px;
}

/* Плавающая кнопка AmoCRM лежит выше окна (z-index 1051) и закрывает плитки — прячем, пока окно открыто */
body.modal-open .amo-button-holder {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .quiz__body > *,
  .quiz__contacts {
    animation: none;
  }

  .qz-tile:hover {
    transform: none;
  }
}

@media (max-width: 575.98px) {
  .quiz {
    padding: 18px 14px 22px;
  }

  .quiz__title {
    font-size: 19px;
  }

  .qz-tiles {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .qz-tile__label {
    padding: 2px 10px 10px;
    font-size: 13px;
  }

  .qz-counts {
    gap: 8px;
  }

  .qz-count {
    height: 56px;
  }
}
