:root {
  --orange: #f88012;
  --orange-hover: #ff9633;
  --orange-active: #d16805;
  --gradient: linear-gradient(94.37deg, #ffa34e 0%, #e49b58 100%);
  --green: #4ac425;
}

html {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  position: relative;
  font-family: "Roboto", sans-serif;
  margin: 0;
}

body.popup-open {
  overflow: hidden;
}

/* Consultation popup */
.consult-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.consult-popup_visible {
  visibility: visible;
  opacity: 1;
}
.consult-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 18, 0.72);
  backdrop-filter: blur(5px);
}
.consult-popup__card {
  position: relative;
  width: min(42rem, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 2.5rem;
  border-radius: 1.75rem;
  background: linear-gradient(145deg, #ffffff 0%, #fffaf4 100%);
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.3);
  transform: translateY(1rem) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.consult-popup_visible .consult-popup__card {
  transform: translateY(0) scale(1);
}
.consult-popup__close {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f2f2f2;
  color: #333;
  cursor: pointer;
  font-size: 1.9rem;
  line-height: 1;
}
.consult-popup__badge {
  display: inline-flex;
  padding: 0.5rem 0.85rem;
  border-radius: 2rem;
  background: #e9f9e4;
  color: #287c10;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.consult-popup__title {
  margin: 1rem 2rem 0.85rem 0;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  line-height: 1.1;
}
.consult-popup__text {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.55;
  color: #454545;
}
.consult-popup__notice {
  display: flex;
  gap: 0.9rem;
  margin: 1.35rem 0;
  padding: 1.1rem;
  border: 1px solid #ffc7c2;
  border-radius: 1rem;
  background: #fff1ef;
}
.consult-popup__notice > span {
  display: grid;
  flex: 0 0 2rem;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #d92d20;
  color: white;
  font-weight: 900;
}
.consult-popup__notice p {
  margin: 0;
  line-height: 1.45;
}
.consult-popup__notice strong {
  color: #c21f16;
}
.consult-popup__cta {
  display: block;
  padding: 1rem 1.25rem;
  border-radius: 0.9rem;
  background: var(--green);
  box-shadow: 0 0.6rem 1.5rem rgba(74, 196, 37, 0.28);
  color: white;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.consult-popup__cta:hover {
  background: #3eaa1d;
  transform: translateY(-2px);
}

@media (max-width: 560px) {
  .consult-popup__card {
    padding: 1.5rem 1.15rem;
    border-radius: 1.25rem;
  }
  .consult-popup__text,
  .consult-popup__cta {
    font-size: 0.95rem;
  }
  .consult-popup__notice {
    gap: 0.65rem;
    padding: 0.85rem;
    font-size: 0.9rem;
  }
}

.bg-cover {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: -1;
  max-width: 100%;
}
@media (max-width: 768px) {
  .bg-cover {
    display: none;
  }
}

button {
  font-family: inherit;
}

.main {
  position: relative;
  padding: 5rem 0;
  overflow: hidden;
}

.container {
  max-width: 84.5rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.hero__title {
  margin: 0;
  font-size: 3rem;
  line-height: 1.2;
  font-weight: 700;
}

.hero__text {
  margin: 0;
  margin-top: 2.5rem;
  line-height: 1.4;
  font-size: 1.25rem;
}

/* Header */
.header {
  box-shadow: 0px 7px 50.4px 0px #00000026;
  padding: 1.125rem;
}
.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 0.5625rem;
  line-height: 1.2;
}
.header__logo-text {
  width: min-content;
}
.header__logo_orange {
  padding: 0.375rem;
  border-radius: 0.375rem;
  background-color: var(--orange);
  color: white;
  line-height: 1;
  font-size: 1.625rem;
}
.header__contacts {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.header__phone {
  text-align: right;
  line-height: 1.4;
}
.header__phone-number {
  line-height: 1.4;
  text-decoration: none;
  color: black;
  font-weight: 700;
  font-size: 1.5rem;
}
.header__phone-number:hover {
  text-decoration: underline;
}
.header__button {
  cursor: pointer;
  padding: 1.125rem 2.5rem;
  box-shadow: 0 0.25rem 1.375rem 0 #e99c56;
  border: 0.125rem solid #ffffff4d;
  background-color: var(--orange);
  border-radius: 0.75rem;
  text-transform: uppercase;
  line-height: 1.4;
  font-weight: 500;
  text-decoration: none;
  color: white;
  transition:
    transform 0.25s ease-in-out,
    background-color 0.25s ease-in-out;
}
.header__button:hover {
  background-color: var(--orange-hover);
  transform: translateY(-0.125rem);
  box-shadow: 0 0.5rem 1.75rem 0 #e99c56aa;
}
.header__button:active {
  background-color: var(--orange-active);
  transform: translateY(-0.0625rem);
}

.header__logo_orange {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.header__logo:hover .header__logo_orange {
  transform: rotate(-6deg) scale(1.08);
}

/* steps */
.steps {
  padding: 2rem;
  margin-top: 2.5rem;
  background: var(--gradient);
  border: 0.125rem solid rgba(0, 0, 0, 0.2);
  border-radius: 1.5rem;
}

/* Обычные шаги квиза (вопросы + контакты) — их количество задаётся в админке,
   поэтому селектор общий, а не по перечисленным номерам. Экраны отказа и
   финальный экран стилизуются отдельно ниже (.step[data-step^="error-step"],
   .step[data-step="final-step"]) и из этого правила исключены. */
.step:not([data-step^="error-step"]):not([data-step="final-step"]) {
  display: none;
  min-height: 29.0625rem;
  justify-content: space-between;
}

@media (max-width: 480px) {
  .step:not([data-step^="error-step"]):not([data-step="final-step"]) {
    min-height: auto;
  }
}

.step:not([data-step^="error-step"]):not([data-step="final-step"]).active {
  display: flex;
  animation: fadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.step__left {
  display: flex;
  flex-direction: column;
  max-width: 29rem;
}
.step__right {
  display: flex;
  flex-direction: column;
  max-width: 38.5rem;
  width: 100%;
}
.step__right_large {
  max-width: 45.75rem;
}
.step__label {
  font-size: 1.375rem;
  line-height: 1.4;
  font-weight: 500;
  color: white;
}
.step__checkbox {
  cursor: pointer;
  display: flex;
  align-items: center;
  color: black;
  line-height: 1.4;
  font-weight: 500;
  gap: 0.75rem;
  padding: 0.75rem 2rem;
  border: 1px solid #00000033;
  box-shadow: 0px 4px 21.2px 0px #00000040;
  border-radius: 0.75rem;
  background-color: white;
  transition:
    background-color 0.25s ease-in-out,
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.step__checkbox:hover {
  background-color: #f5f5f5;
  transform: translateY(-0.0625rem);
}

.step__checkbox.selected {
  background-color: var(--orange-hover);
  border-color: var(--orange);
  animation: optionPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes optionPop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

/* Radio buttons for countries */
.step__options_countries {
  grid-template-columns: 1fr 1fr;
}

.step__radio {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: black;
  line-height: 1.4;
  font-weight: 500;
  padding: 0.75rem 1rem;
  border: 1px solid #00000033;
  box-shadow: 0px 4px 21.2px 0px #00000040;
  border-radius: 0.75rem;
  background-color: white;
  transition: background-color 0.25s ease-in-out;
  user-select: none;
  text-align: center;
}

.step__radio:hover {
  background-color: #f5f5f5;
}

.step__radio input[type="radio"] {
  display: none;
}

.step__radio:has(input[type="radio"]:checked) {
  background-color: var(--orange-hover);
  border-color: var(--orange);
  animation: optionPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.step__radio_other {
  background-color: transparent;
  border: 2px dashed white;
  color: white;
}

.step__radio_other:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.step__radio_other:has(input[type="radio"]:checked) {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: white;
}

.step__country_hidden {
  display: none;
  margin-top: 1rem;
}

.step__country_visible {
  display: block;
}

.step__input_error {
  border-color: red !important;
  box-shadow: 0 0 5px red !important;
}

.step__options_error {
  outline: 3px solid red !important;
  border-radius: 0.75rem;
  padding: 0.25rem;
  background-color: rgba(255, 0, 0, 0.1) !important;
}
.step__input {
  display: block;
  width: 100%;
  padding: 1.5rem 2rem;
  border-radius: 0.75rem;
  border: 1px solid #00000033;
  box-shadow: 0px 4px 21.2px 0px #00000040;
  margin-top: 0.75rem;
  font-size: 1rem;
}
.step__input::placeholder {
  font-weight: 500;
  line-height: 1.4;
  color: rgba(0, 0, 0, 0.25);
  font-family: "Roboto", sans-serif;
}
.step__options {
  margin-top: 0.75rem;
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.step__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}
.step__title {
  color: white;
  font-size: 2.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.step__sub-title {
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.4;
  color: white;
}
.step__text {
  margin-top: 2rem;
  font-size: 1.5rem;
  line-height: 1.4;
  font-weight: 500;
  color: white;
}
.step__bottom {
  margin-top: auto;
}
.step__button {
  margin-top: auto;
  max-width: 17.5rem;
  width: 100%;
  text-align: center;
  padding: 1.5rem;
  background-color: white;
  border-radius: 2.5rem;
  border: none;
  cursor: pointer;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1;
  transition: transform 0.25s ease-in-out;
  color: var(--orange);
}

#otherCountryInput {
  margin-bottom: 1.5rem;
}
#btnStep5 {
  width: 17.5rem;
}

.step__buttons-row {
  margin-top: auto;
}

.step__button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.step__button.loading {
  opacity: 0.7;
  cursor: wait;
}

.step__button:not(:disabled):hover {
  transform: translateY(-0.125rem);
  background-color: #f5f5f5;
}

.step__button:not(:disabled):active {
  transform: translateY(-0.0625rem);
}

.step__button_prev {
  background-color: transparent;
  border: 2px solid white;
  color: white;
  max-width: 17.5rem;
}

.step__button_prev:not(:disabled):hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.step__country {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.step__info {
  width: 100%;
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.75);
}
.step__info-text {
  max-width: 25rem;
  margin-left: auto;
}
.step__consent {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  max-width: 25rem;
  margin-left: auto;
  cursor: pointer;
}
.step__consent input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  margin-top: 0.0625rem;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-radius: 0.375rem;
  background-color: rgba(255, 255, 255, 0.05);
  position: relative;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}
.step__consent input[type="checkbox"]:hover {
  border-color: rgba(255, 255, 255, 0.75);
}
.step__consent input[type="checkbox"]:checked {
  background-color: var(--orange);
  border-color: var(--orange);
  transform: scale(1.05);
}
.step__consent input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 0.375rem;
  top: 0.125rem;
  width: 0.3125rem;
  height: 0.625rem;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}
.step__consent input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.step__consent-text {
  font-size: 0.875rem;
  line-height: 1.4;
}
.step__consent_error .step__consent-text {
  color: #e63535;
}
.step__consent_error input[type="checkbox"] {
  outline: 2px solid #e63535;
  outline-offset: 2px;
  border-radius: 0.1875rem;
}
.step__consent-text a {
  color: inherit;
  text-decoration: underline;
}
.step__consent-text a:hover {
  text-decoration: none;
}

.step__inputs {
  margin-top: 2rem;
}

/* Footer */
.footer {
  padding-bottom: 4rem;
  color: rgba(0, 0, 0, 0.5);
  line-height: 1.4;
}
.footer__under {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.375rem;
  max-width: 60.75rem;
}
.footer__text {
  max-width: 55rem;
}
.footer__link {
  color: inherit;
  text-decoration: none;
}
.footer__link:hover {
  text-decoration: underline;
}

/* Error and Success Steps */
.step[data-step^="error-step"],
.step[data-step="final-step"] {
  display: none;
}

.step[data-step^="error-step"].active,
.step[data-step="final-step"].active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.step[data-step^="error-step"] .step__error,
.step[data-step="final-step"] .step__success {
  display: block;
  padding: 3rem;
  text-align: center;
  width: 100%;
}

.step[data-step^="error-step"] .step__error {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 1.5rem;
}

.step[data-step="final-step"] .step__success {
  background-color: #e9ffec;
  border: 2px dashed var(--green);
  border-radius: 1.5rem;
}

.step__error-title {
  font-size: 2rem;
  color: white;
  text-align: center;
  font-weight: 700;
}

.step__error-text {
  font-size: 1.125rem;
  text-align: center;
  max-width: 38.75rem;
  margin: 1.5rem auto;
  color: white;
  line-height: 1.4;
}

.step__button-error {
  display: block;
  max-width: 13.75rem;
  margin: 0 auto;
  color: var(--orange);
}

.step__success-title {
  font-size: 2rem;
  line-height: 1.4;
  font-weight: 700;
  text-align: center;
  max-width: 30rem;
  margin: 0 auto;
  color: var(--green);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .main {
    padding: 2rem 0;
  }

  .hero__title {
    font-size: 2rem;
  }

  .hero__text {
    font-size: 1rem;
    margin-top: 1.5rem;
  }

  .header {
    padding: 1rem 0;
  }

  .header__container {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .header__logo {
    font-size: 0.5rem;
  }

  .header__logo_orange {
    font-size: 1.25rem;
  }

  .header__contacts {
    gap: 1rem;
  }

  .header__phone-number {
    font-size: 1.125rem;
  }

  .header__button {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
  }

  .steps {
    padding: 1.5rem;
    margin-top: 1.5rem;
  }

  .step {
    flex-direction: column;
    min-height: auto;
  }

  .step__left {
    max-width: 100%;
  }

  .step__right {
    max-width: 100%;
    margin-top: 1.5rem;
  }

  .step__title {
    font-size: 1.5rem;
  }

  .step__text {
    font-size: 1rem;
    margin-top: 1rem;
  }

  .step__sub-title {
    font-size: 1rem;
  }

  .step__options {
    margin-bottom: 1rem;
  }

  .step__checkbox {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  .step__checkbox img {
    width: 24px;
    height: 24px;
  }

  .step__grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .step__input {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }

  .step__label {
    font-size: 1rem;
  }

  .step__button {
    max-width: 100%;
    padding: 1rem;
    font-size: 1rem;
    margin-left: 0;
    margin-top: 1.5rem;
  }

  .step__inputs {
    margin-top: 1rem;
  }

  .step__info {
    flex-direction: column;
    gap: 1rem;
  }

  .step__info-text {
    margin-left: 0;
    max-width: 100%;
    text-align: center;
  }

  .step__error,
  .step__success {
    padding: 2rem 1rem;
  }

  .step__error-title,
  .step__success-title {
    font-size: 1.5rem;
  }

  .step__error-text {
    font-size: 1rem;
  }

  .footer {
    padding-bottom: 2rem;
  }

  .footer__container {
    max-width: 100%;
  }

  .footer__text {
    max-width: 100%;
    font-size: 0.875rem;
  }

  .footer__under {
    flex-wrap: wrap;
    max-width: 100%;
  }

  .footer__link {
    font-size: 0.75rem;
  }

  .footer__copy {
    font-size: 0.75rem;
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }

  .hero__title {
    font-size: 1.5rem;
  }

  .hero__text {
    font-size: 0.875rem;
  }

  .header__logo {
    font-size: 0.375rem;
  }

  .header__logo_orange {
    font-size: 1rem;
  }

  .header__phone {
    text-align: left;
  }

  .header__phone-number {
    font-size: 1rem;
  }

  .header__button {
    display: none;
    font-size: 0.75rem;
  }

  .steps {
    padding: 1rem;
    border-radius: 1rem;
  }

  .step__title {
    font-size: 1.25rem;
  }

  .step__text {
    font-size: 0.875rem;
  }

  .step__sub-title {
    font-size: 0.875rem;
  }

  .step__checkbox {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    gap: 0.5rem;
  }

  .step__checkbox img {
    width: 20px;
    height: 20px;
  }

  .step__options_countries {
    grid-template-columns: 1fr;
  }

  .step__radio {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }

  .step__input {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  .step__label {
    font-size: 0.875rem;
  }

  .step__button {
    font-size: 0.875rem;
  }

  .step__info-text {
    font-size: 0.75rem;
  }

  .step__error,
  .step__success {
    padding: 1.5rem 0.75rem;
  }

  .step__error-title,
  .step__success-title {
    font-size: 1.25rem;
  }

  .step__error-text {
    font-size: 0.875rem;
  }

  .footer {
    padding-bottom: 1.5rem;
  }

  .footer__text {
    font-size: 0.75rem;
  }

  .footer__link {
    font-size: 0.625rem;
  }

  .footer__copy {
    font-size: 0.625rem;
  }
}

/* ==================== Decorative background & entrance animations ==================== */

.decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.decor__blob {
  position: absolute;
  filter: blur(4px);
}
.decor__blob_1 {
  width: 26rem;
  height: 26rem;
  top: -9rem;
  right: -7rem;
  opacity: 0.55;
  animation: decorFloat1 18s ease-in-out infinite;
}
.decor__blob_2 {
  width: 17rem;
  height: 17rem;
  bottom: 0;
  left: -5rem;
  opacity: 0.35;
  animation: decorFloat2 22s ease-in-out infinite;
}
.decor__dots {
  position: absolute;
  width: 8rem;
  height: 8rem;
  right: 8rem;
  top: 4rem;
  opacity: 0.7;
}
@keyframes decorFloat1 {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(-1.25rem, 1.5rem) rotate(8deg);
  }
}
@keyframes decorFloat2 {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(1.25rem, -1rem) rotate(-6deg);
  }
}
@media (max-width: 900px) {
  .decor__blob_1 {
    width: 18rem;
    height: 18rem;
  }
  .decor__blob_2 {
    display: none;
  }
  .decor__dots {
    display: none;
  }
}

.hero,
.steps {
  position: relative;
  z-index: 1;
}

.reveal {
  animation: revealUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.reveal_delay-1 {
  animation-delay: 0.1s;
}
.reveal_delay-2 {
  animation-delay: 0.2s;
}
@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Success checkmark */
.step__success {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.success-check {
  margin-bottom: 1.25rem;
}
.success-check__circle {
  stroke: var(--green);
  stroke-dasharray: 227;
  stroke-dashoffset: 227;
  animation: successCircle 0.6s ease forwards;
}
.success-check__mark {
  stroke: var(--green);
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: successMark 0.35s ease forwards 0.55s;
}
@keyframes successCircle {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes successMark {
  to {
    stroke-dashoffset: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
