/* ---------- Base / Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid rgba(82, 177, 168,.35); outline-offset: 2px; }

:root{
  --purple: #52b1a8;
  --purple-2: #66a49e;
  --purple-3: #3d8f87;

  --ink: #0F172A;
  --muted: rgba(15,23,42,.65);

  --bg: #F6F7FF;
  --card: #FFFFFF;
  --stroke: rgba(15,23,42,.10);

  --r-xl: 22px;
  --r-lg: 18px;
  --r-md: 14px;

  --shadow: 0 18px 50px rgba(15,23,42,.08);

  /* ширина квиза на десктопе */
  --container: 920px;
  /* ширина контента (заголовок + варианты) */
  --content: 720px;
}

/* ---------- Background (NO repeat / NO bottom stripe) ---------- */
body{
  font-family: "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background-color: #ffffff;
  min-height: 100vh;
}

/* ---------- Shell / Layout ---------- */
.quiz-card{
  width: min(var(--container), calc(100% - 24px));
  margin: 16px auto;
  min-height: 100vh;              /* не меньше высоты экрана */
  display: flex;                  /* 3 вертикальные зоны */
  flex-direction: column;
  gap: 14px;
  padding: 0;                     /* padding теперь у панелей */
  background: transparent;
  border: 0;
  box-shadow: none;
  position: relative;
  margin-top: 0!important;
}

@media (min-width: 900px){
  .quiz-card{ 
  margin: 28px auto; 
  margin-top: 0!important;
  }
}
@media (min-width: 1200px){
  .quiz-card{ width: min(980px, calc(100% - 40px)); margin-top: 0!important;}
}

/* Панели: header / content / footer */
.quiz-pane{
  /* background: #fff; */
  /* border: 1px solid var(--stroke); */
  border-radius: var(--r-xl);
  /* box-shadow: var(--shadow); */
}
.quiz-pane--header{
  padding: 0;
  padding-top: 16px;
  display: flex;
  justify-content: center
}
.quiz-pane--content{
  /* padding: 14px 16px; */
  flex: 1 1 auto;                 /* занимает свободное место */
  display: flex;                  /* чтобы контент можно было центрировать */
  align-items: stretch;
}
.quiz-pane--footer{
  padding: 0;
  margin-bottom: 10px;
  border: none;
}
.quiz-pane--footer .quiz-footer {
  padding: 14px 16px;
  border-radius: var(--r-xl);
}

/* На десктопе чуть больше воздуха */
@media (min-width: 900px){
  .quiz-pane--header,
  .quiz-pane--content,
  .quiz-pane--footer{ padding: 18px 20px; }
}

/* ---------- Header / Logo ---------- */
.quiz-logo{
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 10px;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  background: #fff;
  border-radius: 20px;
  padding-right: 12px;
  user-select: none;
  letter-spacing: .01em;
  font-size: 22px;
  color: #222;
  line-height: 1.1;
  font-weight: 800; 
}
.quiz-logo::before,
.quiz-logo::after{ content: none !important; }
.quiz-logo i,
.quiz-logo svg,
.quiz-logo img{ display: none !important; }
.quiz-logo b{ font-weight: 800; 
  color: #52b1a8;}

/* ---------- Screen root ---------- */
.quiz-screen{ margin-top: 0; width: 100%; min-height: 100%; display: flex; flex-direction: column; justify-content: center; }
.quiz-screen-item{
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Hide quiz-section while intro is visible (решает 2 секции одновременно) */
#intro-screen:not([style*="display: none"]) ~ #quiz-section{
  display: none !important;
}

/* Fade hook */
.quiz-fade{ animation: quizFade .18s ease-out; }
@keyframes quizFade{
  from { opacity: .65; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Content panel ---------- */
.screen-content{
  flex: 0 0 auto;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

#quiz-section {
  padding: 24px 16px;
  background: #fff;
  border-radius: var(--r-xl);
  border: 1px solid var(--stroke);
}
#intro-screen {
  padding: 20px;
  background: #f9f9f9;
  border-radius: 32px;
  border: 1px solid var(--stroke);
}

/* ---------- Top bar (progress) ---------- */
.quiz-topbar{
  max-width: var(--content);
  margin: 0 auto 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.quiz-progress-track{
  flex: 1 1 auto;
  height: 10px;
  border-radius: 999px;
  background: rgba(15,23,42,.06);
  overflow: hidden;
}
.quiz-progress-bar#quiz-progress{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--purple-2));
  transition: width .22s ease;
}

/* hide step counters (5/15) */
#quiz-step-counter-bottom,
#quiz-step-counter,
.screen-step-label{ display: none !important; }

/* ---------- ALIGN: header same width as answers + centered ---------- */
.quiz-header{
  max-width: var(--content);
  margin: 0 auto 8px;
}

/* ---------- Typography ---------- */
.screen-title{
  font-size: clamp(24px, 3.2vw, 40px);
  line-height: 1.06;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
}
.screen-description{
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}
.screen-subtitle{
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  margin-top: 8px;
}

/* ---------- Intro (переделан) ---------- */
.intro .screen-content{
  padding: 0;
  border: 0;
  background: transparent;
}
.intro .box{
  max-width: min(var(--container), 980px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
  align-items: center;
  padding: 18px;
  /* border-radius: var(--r-xl); */
  /* background: rgba(82, 177, 168,.04); */
  /* border: 1px solid rgba(15,23,42,.08); */
}
.intro .box-descr{
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-between;
  height: 100%;
}
.intro .screen-titles {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.intro .box-img,
.intro .box-img--mob{
  border-radius: 32px;
}
.intro .box-img{ display:block; }
.intro .box-img--mob{ display:none; }

@media (max-width: 720px){
  .intro .box{
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0;
  }
  .intro .box {
    position: relative
  }
  #intro-start-btn {
    margin: 0 !important
  }
  .box-button {
  position: absolute;
  bottom: 0;
  padding: 10px;
  background: #fff;
  border-radius: 40px;
  border: 1px solid var(--stroke);
  width: 100%;
  }
  .intro .box-img{ display:none; }
  .intro .box-img--mob{ display:block; margin-bottom: 40px;}
}

/* Intro button — центр и тач-friendly */
#intro-start-btn{
  max-width: 520px;
  margin: 14px auto 0;
} 
/* .quiz-screen-item.intro {
  position: relative
}
#intro-start-btn {
  position: absolute;
  left: 0;
  bottom: 0;
  width: auto;
} */
#quiz-section .flex-img-box {
  width: 100%;
  display: flex;
  flex-direction: row;
  border: 1px solid #ddd;
  border-radius: 20px;
  margin-bottom: 10px;
  margin-top: 10px;
  padding: 10px;
}
#quiz-section {
font-size: clamp(16px, calc(16px + (22 - 16) * ((100vw - 320px) / (600 - 320))), 22px);
text-align: left;
font-weight: 500;
line-height: 1.3;
max-width: none;
color: #222;
background: #f9f9f9
}
#quiz-section .flex-img-box.flex-column {
  flex-direction: column;
}
#quiz-section .flex-img-box .img-box {
  width: 100%;
  max-width: 80px;
  display: flex;
}
#quiz-section .flex-img-box.flex-column .img-box {
  width: 100%;
  max-width: 400px;
}
#quiz-section .flex-img-box.flex-column .img-box img {
  border-radius: 20px;
  overflow: hidden;
}
#quiz-section .flex-img-box .img-box img {
  width: 100%;
  height: auto;
  align-self: center;
}
#quiz-section .flex-img-box .text-box {
  width: 100%;
  padding-left: 20px;
}
#quiz-section .flex-img-box.flex-column .text-box {
  padding-left: 0;
}
#quiz-next-row {
  display: flex;
  justify-content: end;
  width: 100%;
  margin-top: 16px;
  max-width: var(--content);
  margin: auto;
  margin-top: 16px;
}
#quiz-next-row #quiz-next-btn {
  width: auto;
}
#quiz-next-btn {
  padding: 16px 32px;
}
/* ---------- Buttons ---------- */
.primary-button,
.btn{
  width: 100%;
  border: 0;
  border-radius: 32px;
  padding: 16px 16px;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #52b1a8, #419e95);
  /* box-shadow: 0 14px 30px rgba(82, 177, 168,.20); */
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}
.primary-button:hover,
.btn:hover{ filter: brightness(1.02); transform: translateY(-1px); }
.primary-button:active,
.btn:active{ transform: translateY(0); filter: brightness(.98); }
.primary-button:disabled,
.btn:disabled{ opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Answers ---------- */
.answers-list{
  margin-top: 16px;
  display: grid;
  gap: 12px;
  max-width: var(--content);
  margin-left: auto;
  margin-right: auto;
}
.answers-list[data-layout="tile"]{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 560px){
  .answers-list[data-layout="tile"]{ grid-template-columns: 1fr; }
}
.answers-list.quiz-options--center{
  grid-template-columns: 1fr !important;
}

.answer-option{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 14px;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.10);
  background: #fff;
  text-align: left;
  transition: transform .10s ease, border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
.answer-option:hover{
  border-color: rgba(82, 177, 168,.30);
  box-shadow: 0 10px 22px rgba(15,23,42,.06);
}
.answer-option:active{ transform: translateY(1px); }

.option-label{
  font-size: 16px;
  line-height: 1.25;
  font-weight: 650;
  color: var(--ink);
}

/* Checkbox indicator (и для single тоже) */
.option-radio{
  width: 28px !important;
  height: 28px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(15,23,42,.14) !important;
  background: rgba(15,23,42,.03) !important;
  position: relative;
  flex: 0 0 auto;
}
.option-radio::after{
  content: "" !important;
  position: absolute;
  inset: 0;
  width: 0;
  height: 0;
}
.option-radio::before{
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 900;
  color: transparent;
  transform: translateY(-.5px);
}
.answer-option[aria-pressed="true"],
.answer-option.is-selected{
  border-color: rgba(82, 177, 168,1);
  background: rgba(82, 177, 168,1);
  color: #fff;
  /* box-shadow: 0 12px 26px rgba(82, 177, 168,.10); */
}
.answer-option[aria-pressed="true"] .option-label,
.answer-option.is-selected .option-label{
  color: #fff;
}
.answer-option[aria-pressed="true"] .option-radio,
.answer-option.is-selected .option-radio{
  border-color: rgba(255,255,255,1) !important;
  background: rgba(255,255,255,1) !important;
}
.answer-option[aria-pressed="true"] .option-radio::before,
.answer-option.is-selected .option-radio::before{
  color: var(--purple);
}

/* ---------- Input step ---------- */
.quiz-input-wrap{
  width: min(560px, 100%);
  margin: 8px auto 0;
  padding: 16px;
  border-radius: var(--r-xl);
  border: 1px solid var(--stroke);
  background: rgba(82, 177, 168,.04);
  border: 1px solid rgba(15,23,42,.08);
}
.quiz-input-label{
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(15,23,42,.55);
  margin-bottom: 10px;
}
.quiz-input-row{
  display:flex;
  align-items: stretch;
  gap: 10px;
}
.quiz-input-field{
  flex: 1 1 auto;
  background: #fff;
  border: 1px solid rgba(15,23,42,.14);
  border-radius: 14px;
  padding: 14px 14px;
  font-size: 18px;
  font-weight: 750;
  color: var(--ink);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.quiz-input-field:focus{
  border-color: rgba(82, 177, 168,.55);
  box-shadow: 0 0 0 5px rgba(82, 177, 168,.12);
}
.quiz-input-suffix{
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(15,23,42,.03);
  color: rgba(15,23,42,.70);
  display:flex;
  align-items:center;
  font-weight: 700;
}

/* ---------- INFO / AJAX content (плоско — без “карточки в карточке”) ---------- */
.quiz-text-block,
.quiz-result-body{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  color: rgba(15,23,42,.92);
  line-height: 1.55;
  max-width: var(--content);
  margin-left: auto;
  margin-right: auto;
}
.quiz-text-block p,
.quiz-result-body p{ margin: 0 0 12px; }
.quiz-text-block p:last-child,
.quiz-result-body p:last-child{ margin-bottom: 0; }
.quiz-text-block h3,
.quiz-result-body h3{ margin: 14px 0 10px; font-size: 18px; }
.quiz-text-block img,
.quiz-result-body img{ border: 0 !important; border-radius: 16px !important; }

.quiz-result-title{
  max-width: var(--content);
  margin: 6px auto 10px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

/* Sticky continue button (AJAX) */
.quiz-result-actions{
  position: sticky;
  bottom: 12px;
  padding-top: 12px;
  margin-top: 12px;
  max-width: var(--content);
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(180deg, rgba(246,247,255,0), rgba(246,247,255,.92) 40%, rgba(246,247,255,1));
  z-index: 2;
}
#quiz-continue-btn{ border-radius: 16px; }

/* Lists (AJAX) */
.list-check, .list-cross{
  list-style: none;
  padding-left: 0;
  margin: 12px 0;
  display: grid;
  gap: 10px;
}
.list-check li, .list-cross li{
  padding-left: 38px;
  position: relative;
  font-weight: 650;
  color: rgba(15,23,42,.92);
}
.list-check li::before, .list-cross li::before{
  content:"";
  position:absolute;
  left: 0;
  top: 1px;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(15,23,42,.03);
}
.list-check li::after, .list-cross li::after{
  position:absolute;
  left: 8px;
  top: 6px;
  font-weight: 900;
  font-size: 14px;
}
.list-check li::after{ content:"✓"; color: var(--purple); }
.list-cross li::after{ content:"✕"; color: rgba(239,68,68,1); }

/* Callout boxes (AJAX) */
.red-box, .blue-box{
  margin: 14px 0;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.10);
}
.red-box{
  border-color: rgba(239,68,68,.30);
  background: linear-gradient(180deg, rgba(239,68,68,.08), rgba(255,255,255,1));
}
.blue-box{
  border-color: rgba(82, 177, 168,.30);
  background: linear-gradient(180deg, rgba(82, 177, 168,.08), rgba(255,255,255,1));
}
.red-box p, .blue-box p{ margin: 0; }

/* Image + text rows (AJAX) */
.flex-img-box{
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  align-items: start;
  margin: 14px 0;
}
.img-box img{
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 16px;
  border: 0;
}
.text-box{ color: rgba(15,23,42,.86); line-height: 1.5; }
@media (max-width: 560px){
  .flex-img-box{ grid-template-columns: 1fr; }
  .img-box img{ width: 100%; height: auto; }
}

/* Order form (AJAX) */
.order-card{
  border-radius: var(--r-xl);
  border: 1px solid rgba(15,23,42,.10);
  background: #fff;
  padding: 16px;
  margin-top: 10px;
}
.order-title{
  font-size: 20px;
  font-weight: 900;
  text-align: left;
  margin: 0 0 10px;
}
.order-subtitle,
.order-note{
  color: rgba(15,23,42,.70);
  margin-bottom: 12px;
  line-height: 1.45;
  text-align: left;
}
.order-form{ display: grid; gap: 12px; margin-top: 10px; }
.order-field{ display: grid; gap: 6px; }
.order-label{
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(15,23,42,.55);
}
.order-input{
  width: 100%;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.14);
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.order-input:focus{
  border-color: rgba(82, 177, 168,.55);
  box-shadow: 0 0 0 5px rgba(82, 177, 168,.12);
}

/* phone plugin */
.phone-wrap{ display:flex; gap:10px; align-items:stretch; }
.phone-prefix{
  flex:0 0 56px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:15px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(15,23,42,.03);
  user-select:none;
}
.phone-input{ flex:1; }

/* errors */
.pp-inline-error{
  display:none;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(239,68,68,.28);
  background: rgba(239,68,68,.08);
  color: rgba(15,23,42,.90);
  font-size: 13px;
  line-height: 1.25;
}
.pp-inline-error.pp-show{ display:block; }
.pp-invalid{
  border-color: rgba(239,68,68,.55) !important;
  box-shadow: 0 0 0 5px rgba(239,68,68,.12) !important;
}

/* Footer */
.quiz-footer{
  display:flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  color: rgba(15,23,42,.60);
  font-size: 13px;
}
@media (min-width: 720px){
  .quiz-footer{ justify-content: space-between; }
}

.quiz-footer a{
  /* color: rgba(82, 177, 168,.90); */
  color: rgba(15,23,42,.60);
}
.quiz-footer a:hover{
  color: rgba(109,40,217,1);
}

/* Overlay loader (LIGHT) */
.quiz-overlay-loader{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.74);
  z-index: 9998;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.quiz-overlay-loader__spinner{
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid rgba(82, 177, 168,.18);
  border-top-color: rgba(82, 177, 168,.95);
  animation: spin 1s linear infinite;
  box-shadow: 0 18px 50px rgba(82, 177, 168,.14);
}
@keyframes spin{ to{ transform: rotate(360deg); } }

/* Modal (центр + скролл) */
.modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.modal.is-open{ display: flex; }
.modal__backdrop{
  position:absolute;
  inset:0;
  background: rgba(15,23,42,.20);
}
.modal__dialog{
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(880px, 100%);
  max-height: 86vh;
  border-radius: var(--r-xl);
  background: #fff;
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 24px 80px rgba(15,23,42,.22);
  overflow: hidden;
  z-index: 1;
}
.modal__title{
  margin: 0;
  padding: 16px 18px;
  font-size: 18px;
  font-weight: 900;
  border-bottom: 1px solid rgba(15,23,42,.08);
  flex: 0 0 auto;
}
.modal__content{
  padding: 14px 18px 18px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(15,23,42,.92);
  flex: 1 1 auto;
}
.modal__actions{
  padding: 12px 18px;
  border-top: 1px solid rgba(15,23,42,.08);
  display:flex;
  justify-content:flex-end;
  gap: 10px;
  flex: 0 0 auto;
}
.modal__btn{
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, var(--purple-2), var(--purple));
}
.modal__close{
  position:absolute;
  top: 10px;
  right: 10px;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(15,23,42,.04);
  color: rgba(15,23,42,.85);
  font-size: 26px;
  line-height: 1;
}
.modal__close:hover{ background: rgba(15,23,42,.07); }
body.modal-open{ overflow: hidden; }

@media (max-width: 560px){
  .modal__dialog{ max-height: 90vh; }
  .modal__content{ padding: 12px 14px 16px; }
}

/* Links inside AJAX blocks */
.quiz-result-body a,
.quiz-text-block a{
  color: rgba(82, 177, 168,.95) !important;
  border-bottom: 1px dotted rgba(82, 177, 168,.35);
}
.quiz-result-body a:hover,
.quiz-text-block a:hover{
  color: rgba(65, 158, 149,1) !important;
  border-bottom-color: rgba(65, 158, 149,.50);
}

/* Mobile tap targets */
@media (max-width: 420px){
  .quiz-card{ width: calc(100% - 16px); padding: 14px; }
  .primary-button, .btn{ font-size: 18px; padding: 16px; border-radius: 16px; }
  .answer-option{ padding: 16px 14px; }
}
