/* ============================================================
   Кастомный квиз-подбор программы для partner.mti-university.ru
   Фирменный стиль mti.moscow (Montserrat, жёлтый #f9db00, серый #2b2b2b).
   ============================================================ */

.mq {
  --mq-yellow:     #f9db00;
  --mq-yellow-sat: #ffc701;
  --mq-yellow-lt:  #fffce9;
  --mq-ink:        #2b2b2b;
  --mq-ink-soft:   #7e7e7e;
  --mq-border:     #e2e2e2;
  font-family: 'Montserrat', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}
.mq *,
.mq *::before,
.mq *::after { box-sizing: border-box; }

/* секция-обёртка на странице */
.mq-section {
  padding: 70px 20px;
  background: #ffffff;
}

/* внешняя рамка-«подсветка» как на оригинале */
.mq {
  max-width: 1060px;
  margin: 0 auto;
  background: var(--mq-yellow-lt);
  border-radius: 0;
  padding: 14px;
}

/* двухколоночная раскладка: контент + панель консультанта */
.mq__grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  background: #ffffff;
  border-radius: 0;
  overflow: hidden;
  min-height: 560px;
}

/* ---------- левая колонка: контент ---------- */
.mq__main {
  display: flex;
  flex-direction: column;
  padding: 40px 44px 32px;
}

.mq__progress {
  height: 6px;
  border-radius: 0;
  background: #ededed;
  overflow: hidden;
  margin-bottom: 34px;
}
.mq__progress-fill {
  height: 100%;
  width: 0;
  border-radius: 0;
  background: var(--mq-yellow);
  transition: width .35s ease;
}

.mq__steps { flex: 1 1 auto; }

.mq__step { display: none; animation: mq-fade .3s ease; }
.mq__step.is-active { display: block; }
@keyframes mq-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mq__question {
  font-size: 30px;
  line-height: 1.22;
  font-weight: 800;
  color: var(--mq-ink);
  margin: 0 0 6px;
}
.mq__subtitle {
  font-size: 15px;
  color: var(--mq-ink-soft);
  margin: 0 0 24px;
}
.mq__question + .mq__options,
.mq__question + .mq__field { margin-top: 26px; }

/* ---------- варианты ответа ---------- */
.mq__options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.mq__options_one { grid-template-columns: 1fr; }

.mq__option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 1.5px solid var(--mq-border);
  border-radius: 0;
  cursor: pointer;
  transition: border-color .18s, background .18s, box-shadow .18s;
  background: #fff;
}
.mq__option:hover {
  border-color: var(--mq-yellow-sat);
  box-shadow: 0 4px 14px rgba(247, 198, 0, .18);
}
.mq__option input { position: absolute; opacity: 0; pointer-events: none; }

.mq__radio {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 2px solid #cfcfcf;
  border-radius: 50%;
  transition: border-color .18s;
  position: relative;
}
.mq__radio::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--mq-yellow);
  transform: scale(0);
  transition: transform .18s;
}
.mq__option-text {
  font-size: 15px;
  line-height: 1.35;
  color: var(--mq-ink);
}

.mq__option input:checked ~ .mq__radio { border-color: var(--mq-yellow-sat); }
.mq__option input:checked ~ .mq__radio::after { transform: scale(1); }
.mq__option.is-checked {
  border-color: var(--mq-yellow-sat);
  background: #fffdf0;
}

/* ---------- текстовые поля ---------- */
.mq__field { display: flex; flex-direction: column; gap: 14px; max-width: 460px; }

.mq__input,
.mq__select {
  width: 100%;
  height: 58px;
  padding: 0 20px;
  border: 1.5px solid var(--mq-border);
  border-radius: 0;
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  color: var(--mq-ink);
  outline: none;
  transition: border-color .18s;
}
.mq__input:focus,
.mq__select:focus { border-color: var(--mq-yellow-sat); }
.mq__input::placeholder { color: #a5a5a5; }
.mq__select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath fill='none' stroke='%236b6b6b' stroke-width='2' d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 20px center;
}

.mq__consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--mq-ink-soft);
  cursor: pointer;
  margin-top: 2px;
}
.mq__consent input {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  margin-top: 1px;
  accent-color: var(--mq-yellow-sat);
}
.mq__consent a { color: var(--mq-ink-soft); text-decoration: underline; }

.mq__error {
  display: none;
  margin-top: 14px;
  color: #d23b3b;
  font-size: 13.5px;
}

/* ---------- футер с навигацией ---------- */
.mq__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid #f0f0f0;
}
.mq__counter {
  font-size: 14px;
  color: #9a9a9a;
}
.mq__nav { display: flex; gap: 12px; }

.mq__btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 54px;
  padding: 0 28px;
  border: 0;
  border-radius: 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s, opacity .15s;
}
.mq__btn:disabled { opacity: .55; cursor: default; }
.mq__btn_next {
  background: var(--mq-yellow);
  color: var(--mq-ink);
}
.mq__btn_next:hover:not(:disabled) { filter: brightness(.96); }
.mq__btn_back {
  width: 54px;
  padding: 0;
  justify-content: center;
  background: var(--mq-yellow-lt);
  color: var(--mq-ink);
}
.mq__btn_back:hover { filter: brightness(.97); }
.mq__btn_back[hidden] { display: none; }

/* ---------- правая панель: консультант ---------- */
.mq__aside {
  background: var(--mq-yellow-lt);
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.mq__aside-title {
  font-size: 14px;
  font-weight: 600;
  color: #8a7e2e;
}
.mq__consultant { display: flex; flex-direction: column; gap: 14px; }
.mq__consultant-photo {
  width: 76px;
  height: 76px;
  border-radius: 0;
  object-fit: cover;
}
.mq__consultant-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--mq-ink);
}
.mq__consultant-role {
  font-size: 13px;
  color: var(--mq-ink-soft);
  margin-top: 2px;
}
.mq__bubble {
  position: relative;
  background: #fff;
  border-radius: 0;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.5;
  color: #3a3a3a;
}
.mq__bubble::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 22px;
  border: 8px solid transparent;
  border-top: 0;
  border-bottom: 9px solid #fff;
}

/* ---------- экран «спасибо» ---------- */
.mq__success {
  display: none;
  padding: 30px 4px;
}
.mq__success-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--mq-yellow);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 22px;
}
.mq__success-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--mq-ink);
  margin: 0 0 12px;
}
.mq__success-text {
  font-size: 16px;
  line-height: 1.55;
  color: var(--mq-ink-soft);
  max-width: 480px;
}

/* ---------- адаптив ---------- */
@media (max-width: 880px) {
  .mq__grid { grid-template-columns: 1fr; }
  .mq__aside { order: -1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px; padding: 22px 24px; }
  .mq__aside-title { width: 100%; }
  .mq__consultant { flex-direction: row; align-items: center; flex: 1 1 200px; }
  .mq__bubble { flex: 1 1 100%; }
  .mq__bubble::before { display: none; }
}
@media (max-width: 600px) {
  .mq-section { padding: 36px 12px; }
  .mq { padding: 8px; border-radius: 0; }
  .mq__main { padding: 26px 20px 22px; }
  .mq__question { font-size: 23px; }
  .mq__options { grid-template-columns: 1fr; }
  .mq__footer { flex-direction: column-reverse; gap: 16px; align-items: stretch; }
  .mq__nav { justify-content: flex-end; }
  .mq__counter { text-align: center; }
  .mq__consultant-photo { width: 60px; height: 60px; }
}

/* ============================================================
   Квиз внутри всплывающего окна (#popup:quiz).
   Контейнер Tilda-попапа отдаёт всю площадь карточке .mq,
   на мобильных окно раскрывается на весь экран и прокручивается.
   ============================================================ */
.t-popup__container--mq {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  padding: 0 !important;
  width: 100%;
  max-width: 1100px;
  max-height: 94vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mq--popup {
  margin: 0;
  max-width: 100%;
}

/* Tilda-анимация «появление при прокрутке» в статической копии не
   снимает класс r_hidden (её скрипт не инициализируется). Запись с
   поп-апом позиционируется fixed и обязана открываться в любой момент,
   поэтому гасить её прозрачностью нельзя. */
.t-rec.r_hidden:has(.t-popup) { opacity: 1 !important; }
@media (max-width: 600px) {
  .t-popup__container--mq {
    max-height: 100vh;
    min-height: 100vh;
  }
  .mq--popup {
    border-radius: 0;
    padding: 8px;
    min-height: 100vh;
  }
}
