/* ===========================
   IDEN — Hero Quiz styles v4
   Apple-elegant + фиксированная высота + плавные переходы
   =========================== */

.hquiz {
  position: relative;
  width: 100%;
  max-width: 440px;
  min-height: 580px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 26px;
  padding: 32px 32px 28px;
  box-shadow:
    0 24px 56px -8px rgba(0, 0, 0, 0.18),
    0 8px 20px -8px rgba(0, 0, 0, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.04);
  color: #1d1d1f;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* === Top: heading + discount === */
.hquiz__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 22px;
  flex-shrink: 0;
}
.hquiz__heading { flex: 1; min-width: 0; }
.hquiz__h {
  font: 500 19px/1.18 'Inter', sans-serif;
  letter-spacing: -0.018em;
  color: #1d1d1f;
}
.hquiz__h + .hquiz__h { margin-top: 2px; }
.hquiz__h-extra {
  font: 500 13.5px/1.35 'Inter', sans-serif;
  letter-spacing: -0.005em;
  color: #dc2626;
  margin-top: 8px;
}

.hquiz__badge {
  flex-shrink: 0;
  min-width: 90px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #f5f5f7;
  text-align: center;
  transition: background 220ms;
}
.hquiz__badge-label {
  font: 400 11px/1 'Inter', sans-serif;
  color: #6e6e73;
  margin: 0 0 5px;
  letter-spacing: -0.005em;
}
.hquiz__badge-value {
  font: 600 22px/1 'Inter', sans-serif;
  color: #1d1d1f;
  letter-spacing: -0.02em;
  transition: color 220ms;
}

/* === Progress bar === */
.hquiz__bar {
  height: 2px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 0 24px;
  flex-shrink: 0;
}
.hquiz__bar > span {
  display: block;
  height: 100%;
  background: #1d1d1f;
  border-radius: 999px;
  transition: width 420ms cubic-bezier(0.22, 0.8, 0.2, 1);
}

/* === Question === */
.hquiz__qlabel {
  font: 500 15.5px/1.32 'Inter', sans-serif;
  color: #1d1d1f;
  margin: 0 0 16px;
  letter-spacing: -0.012em;
  flex-shrink: 0;
  animation: hquizStepIn 340ms cubic-bezier(0.22, 0.8, 0.2, 1);
}

.hquiz__sub {
  font: 400 13px/1.5 'Inter', sans-serif;
  color: #6e6e73;
  margin: -8px 0 16px;
  flex-shrink: 0;
  animation: hquizStepIn 340ms cubic-bezier(0.22, 0.8, 0.2, 1);
}

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

/* === Options (radio) === */
.hquiz__opts {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 0 22px;
  flex-shrink: 0;
  animation: hquizStepIn 380ms cubic-bezier(0.22, 0.8, 0.2, 1) 40ms both;
}
.hquiz__opt {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 15px 18px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  background: #ffffff;
  color: #1d1d1f;
  font: 400 14.5px/1.3 'Inter', sans-serif;
  letter-spacing: -0.008em;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms, background 180ms, transform 100ms;
}
.hquiz__opt:hover { border-color: rgba(0, 0, 0, 0.18); background: #fafafb; }
.hquiz__opt:active { transform: scale(0.998); }
.hquiz__opt.is-selected {
  border-color: #1d1d1f;
  background: #ffffff;
}

.hquiz__radio {
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: border-color 180ms;
}
.hquiz__opt.is-selected .hquiz__radio { border-color: #1d1d1f; }
.hquiz__opt.is-selected .hquiz__radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: #dc2626;
  border-radius: 50%;
  animation: hquizRadioPop 220ms cubic-bezier(0.22, 1.4, 0.4, 1);
}
@keyframes hquizRadioPop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}
.hquiz__opt-text { display: block; flex: 1; }

/* === Foot — всегда внизу карточки благодаря margin-top: auto === */
.hquiz__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  flex-shrink: 0;
}
.hquiz__foot--contact { margin-top: 16px; }
.hquiz__foot-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.hquiz__step-meta {
  font: 400 12.5px/1 'Inter', sans-serif;
  color: #86868b;
  letter-spacing: -0.005em;
}

.hquiz__back {
  background: transparent;
  border: 0;
  padding: 4px 0;
  font: 400 13px/1 'Inter', sans-serif;
  color: #6e6e73;
  cursor: pointer;
  transition: color 160ms;
  letter-spacing: -0.005em;
}
.hquiz__back:hover { color: #1d1d1f; }
.hquiz__back--center { display: block; margin: 14px auto 0; }

.hquiz__next {
  padding: 13px 26px;
  border-radius: 980px;
  background: #1d1d1f;
  color: #ffffff;
  font: 500 14px/1 'Inter', sans-serif;
  letter-spacing: -0.005em;
  border: 0;
  cursor: pointer;
  transition: background 180ms, transform 100ms, box-shadow 220ms;
  white-space: nowrap;
}
.hquiz__next:hover { background: #000000; box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.3); transform: translateY(-1px); }
.hquiz__next:active { transform: translateY(0); }

/* === Contact form === */
.hquiz__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0 0;
  animation: hquizStepIn 380ms cubic-bezier(0.22, 0.8, 0.2, 1) 40ms both;
}
.hquiz__input {
  width: 100%;
  padding: 15px 17px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #ffffff;
  font: 400 15px/1 'Inter', sans-serif;
  letter-spacing: -0.005em;
  color: #1d1d1f;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 180ms, box-shadow 180ms;
}
.hquiz__input::placeholder { color: #aeaeb2; }
.hquiz__input:focus {
  outline: none;
  border-color: #1d1d1f;
  box-shadow: 0 0 0 4px rgba(29, 29, 31, 0.05);
}

.hquiz__check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font: 400 12px/1.4 'Inter', sans-serif;
  color: #6e6e73;
  cursor: pointer;
  padding: 4px 2px;
}
.hquiz__check input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: #1d1d1f;
  cursor: pointer;
}
.hquiz__check a { color: #1d1d1f; text-decoration: underline; text-decoration-color: rgba(29, 29, 31, 0.3); }

.hquiz__submit {
  display: block;
  width: 100%;
  padding: 17px 22px;
  border-radius: 16px;
  background: #1d1d1f;
  color: #ffffff;
  font: 500 15px/1 'Inter', sans-serif;
  letter-spacing: -0.005em;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  margin: 6px 0 0;
  transition: background 220ms, transform 100ms, box-shadow 220ms;
}
.hquiz__submit:hover { background: #000000; transform: translateY(-1px); box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.3); }
.hquiz__submit:active { transform: translateY(0); }
.hquiz__submit:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }

.hquiz__error {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(220, 38, 38, 0.05);
  color: #b91c1c;
  font: 400 12.5px/1.3 'Inter', sans-serif;
  margin: 4px 0 0;
}

/* === Success === */
.hquiz__success {
  text-align: center;
  padding: 12px 0 4px;
  animation: hquizStepIn 420ms cubic-bezier(0.22, 0.8, 0.2, 1);
}
.hquiz__check-svg { width: 56px; height: 56px; margin: 0 auto 16px; display: block; }
.hquiz__success-title {
  font: 500 24px/1.18 'Inter', sans-serif;
  letter-spacing: -0.022em;
  color: #1d1d1f;
  margin: 0 0 10px;
}
.hquiz__success-sub {
  font: 400 14px/1.5 'Inter', sans-serif;
  color: #6e6e73;
  margin: 0 0 20px;
  letter-spacing: -0.005em;
}
.hquiz__order {
  margin: 16px 0 0;
  font: 400 11px/1 'Inter', sans-serif;
  color: #aeaeb2;
  letter-spacing: 0.02em;
}

/* === Mobile typography fix: H1 + sub hero не влезают на 375px === */
@media (max-width: 480px) {
  .home-hero .home-hero__inner,
  .home-hero .home-hero__copy {
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box !important;
  }
  .home-hero h1 {
    font-size: 38px !important;
    line-height: 1.06 !important;
    letter-spacing: -0.02em !important;
    word-break: keep-all;
  }
  .home-hero__sub {
    font-size: 14px !important;
    line-height: 1.45 !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }
}
@media (max-width: 360px) {
  .home-hero h1 { font-size: 32px !important; }
  .home-hero__sub { font-size: 13px !important; }
}

/* === CTA section (внутренние страницы — каталог, услуги, гео, блог, декоры) === */
.cta-quiz-section {
  padding: 96px 24px;
  background: #fafafa;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}
.cta-quiz-section__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 440px);
  gap: 64px;
  align-items: center;
}
.cta-quiz-section__copy { color: #1d1d1f; }
.cta-quiz-section__copy .eyebrow {
  display: inline-block;
  font: 500 12px/1 'Inter', sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #86868b;
  margin: 0 0 16px;
}
.cta-quiz-section__copy h2 {
  font: 300 clamp(34px, 4.6vw, 52px)/1.06 'Inter', sans-serif;
  letter-spacing: -0.022em;
  color: #1d1d1f;
  margin: 0 0 18px;
}
.cta-quiz-section__copy p {
  font: 400 clamp(15px, 1.4vw, 18px)/1.5 'Inter', sans-serif;
  color: #515154;
  max-width: 540px;
  margin: 0;
}
.cta-quiz-section__slot {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 980px) {
  .cta-quiz-section { padding: 64px 16px; }
  .cta-quiz-section__inner {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }
  .cta-quiz-section__copy p { margin: 0 auto; }
  .cta-quiz-section__slot { justify-content: center; }
}

/* === Slot layout (desktop = в hero справа, mobile = отдельной секцией ниже) === */
.home-hero__quiz-slot {
  display: flex;
  justify-content: flex-end;
}
.home-hero--with-quiz .home-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 440px);
  gap: 64px;
  align-items: center;
}

/* Mobile: квиз вынесен JS-ом ниже hero, идёт как отдельная секция */
.home-hero__quiz-slot--mobile {
  justify-content: center;
  padding: 56px 16px 64px;
  background: #fafafa;
}

@media (max-width: 980px) {
  .home-hero--with-quiz .home-hero__inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .home-hero__quiz-slot { justify-content: center; }
  .hquiz {
    max-width: 100%;
    min-height: 520px;
    padding: 26px 24px 24px;
    border-radius: 22px;
  }
  .hquiz__h-extra { font-size: 12.5px; margin-top: 6px; }
  .hquiz__h { font-size: 17px; }
  .hquiz__badge { min-width: 78px; padding: 9px 12px; }
  .hquiz__badge-value { font-size: 19px; }
  .hquiz__qlabel { font-size: 15px; }
  .hquiz__opt { padding: 14px 16px; font-size: 14px; }
  .hquiz__next { padding: 12px 22px; font-size: 13.5px; }
  .hquiz__submit { padding: 16px 20px; font-size: 14.5px; }
}
