/* ============================================================
   YPONTON.RU — модалка квиза «Подбор причала»
   Префикс yp-quiz-. Цвета: синий #11233f, оранжевый #f78e1f. Шрифт Onest.
   ============================================================ */
.yp-quiz-overlay, .yp-quiz-overlay *, .yp-quiz-overlay *::before, .yp-quiz-overlay *::after { box-sizing: border-box; }

.yp-quiz-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 16, 30, .62);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s;
  font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.yp-quiz-overlay.is-open { opacity: 1; visibility: visible; }

.yp-quiz {
  position: relative;
  width: min(660px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 40px 90px rgba(8, 16, 30, .45);
  transform: translateY(14px);
  transition: transform .22s ease;
  -webkit-font-smoothing: antialiased;
  color: #11233f;
}
.yp-quiz-overlay.is-open .yp-quiz { transform: translateY(0); }

/* Шапка модалки */
.yp-quiz__top {
  padding: 26px 30px 0;
}
.yp-quiz__brand {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #f78e1f;
}
.yp-quiz__heading {
  margin: 6px 0 16px;
  font-size: 22px;
  font-weight: 800;
}
.yp-quiz__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: #f1f4f8;
  color: #5b6678;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.yp-quiz__close:hover { background: #e6eaf0; color: #11233f; }
.yp-quiz__close svg { width: 20px; height: 20px; }

/* Прогресс */
.yp-quiz__progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.yp-quiz__bar {
  flex: 1;
  height: 6px;
  border-radius: 6px;
  background: #eef1f5;
  overflow: hidden;
}
.yp-quiz__bar i {
  display: block;
  height: 100%;
  width: 14%;
  border-radius: 6px;
  background: linear-gradient(90deg, #f78e1f, #ffb35c);
  transition: width .3s ease;
}
.yp-quiz__counter {
  flex: none;
  font-size: 13px;
  font-weight: 700;
  color: #8b94a3;
  white-space: nowrap;
}

/* Шаги */
.yp-quiz__body { padding: 0 30px 30px; }
.yp-quiz__step { display: none; }
.yp-quiz__step.is-active { display: block; animation: yp-quiz-fade .25s ease; }
@keyframes yp-quiz-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.yp-quiz__q {
  margin: 0 0 16px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}

/* Варианты */
.yp-quiz__options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.yp-quiz__opt {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  padding: 16px 18px;
  border: 1.5px solid #e4e8ef;
  border-radius: 13px;
  background: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #1f2c44;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
}
.yp-quiz__opt:hover { border-color: #f78e1f; background: #fff7ef; }
.yp-quiz__opt:active { transform: scale(.99); }
.yp-quiz__opt.is-active { border-color: #f78e1f; background: #fff3e6; }
.yp-quiz__opt span {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid #d3d9e2;
  position: relative;
  transition: border-color .15s;
}
.yp-quiz__opt:hover span, .yp-quiz__opt.is-active span { border-color: #f78e1f; }
.yp-quiz__opt.is-active span::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #f78e1f;
}

/* Контактный шаг */
.yp-quiz__fields { display: flex; flex-direction: column; gap: 12px; }
.yp-quiz__field input {
  width: 100%;
  border: 1.5px solid #e4e8ef !important;
  border-radius: 12px !important;
  background: #f7f9fc !important;
  padding: 15px 18px !important;
  height: auto !important;
  margin: 0 !important;
  font: inherit !important;
  font-size: 15px !important;
  color: #11233f !important;
  box-shadow: none !important;
  transition: border-color .15s, background .15s;
}
.yp-quiz__field input:focus { border-color: #f78e1f !important; background: #fff !important; outline: none !important; }
.yp-quiz__field input::placeholder { color: #9aa4b3; }

.yp-quiz__consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #7a8496;
}
.yp-quiz__consent input { margin-top: 2px; accent-color: #f78e1f; }
.yp-quiz__consent a { color: #11233f; text-decoration: underline; }

/* Кнопки навигации */
.yp-quiz__nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
.yp-quiz__back {
  display: none;
  align-items: center;
  gap: 7px;
  border: none;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #8b94a3;
  cursor: pointer;
  padding: 10px 4px;
  transition: color .15s;
}
.yp-quiz__back:hover { color: #11233f; }
.yp-quiz__back svg { width: 16px; height: 16px; }
.yp-quiz.is-step-first .yp-quiz__back { display: none; }

.yp-quiz__submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: #f78e1f;
  color: #fff;
  border: none;
  border-radius: 13px;
  padding: 0 30px;
  height: 54px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s;
}
.yp-quiz__submit:hover { background: #e67d0c; }
.yp-quiz__submit:disabled { opacity: .6; cursor: default; }
.yp-quiz__submit svg { width: 18px; height: 18px; }

.yp-quiz__hint { margin-top: 12px; font-size: 12px; color: #9aa4b3; }
.yp-quiz__error { margin-top: 12px; font-size: 13.5px; font-weight: 600; color: #e23b3b; display: none; }
.yp-quiz__error.is-show { display: block; }

/* Honeypot */
.yp-quiz__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Экран успеха */
.yp-quiz__done { display: none; padding: 44px 30px 40px; text-align: center; }
.yp-quiz__done.is-show { display: block; }
.yp-quiz__done-ico {
  width: 74px; height: 74px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #eaf7ee;
  display: flex; align-items: center; justify-content: center;
  color: #2bb24c;
}
.yp-quiz__done-ico svg { width: 38px; height: 38px; }
.yp-quiz__done h3 { margin: 0 0 8px; font-size: 22px; font-weight: 800; }
.yp-quiz__done p { margin: 0; font-size: 15px; color: #6a7588; line-height: 1.5; }

/* Адаптив */
@media (max-width: 560px) {
  .yp-quiz__top { padding: 22px 20px 0; }
  .yp-quiz__body { padding: 0 20px 24px; }
  .yp-quiz__heading { font-size: 19px; }
  .yp-quiz__q { font-size: 17px; }
  .yp-quiz__options { grid-template-columns: 1fr; }
  .yp-quiz__submit { width: 100%; justify-content: center; padding: 0 20px; }
  .yp-quiz__nav { flex-wrap: wrap; }
}
