/* ==========================================================================
   NOMADO — Секция «Интерактивный квиз»
   Тёмная бордовая «framed»-панель. Экраны: старт → вопрос (прогресс + варианты
   с подсветкой верного/неверного) → результат с уровнем «Nomado Insider».
   ========================================================================== */

.quiz {
  position: relative; margin: var(--nm-section-gap) 0;
  padding: clamp(44px, 5.5vw, 96px) clamp(22px, 4vw, 74px);
  border-radius: var(--nm-radius-lg);
  background: var(--nm-black); color: var(--nm-text);
  overflow: hidden; border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 40px 90px -50px rgba(0, 0, 0, .8);
}
.quiz::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(72% 62% at 50% -6%, rgba(242, 53, 0, .24) 0%, rgba(120, 30, 0, .1) 42%, transparent 68%),
    var(--nm-bg-radial);
}
.quiz::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: var(--nm-grid); background-size: 68px 68px; opacity: .3;
  -webkit-mask-image: radial-gradient(130% 100% at 50% 0%, #000 22%, transparent 86%);
          mask-image: radial-gradient(130% 100% at 50% 0%, #000 22%, transparent 86%);
}
.quiz__dots {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url('../bg/world-map-dots.webp') center / cover no-repeat; opacity: .07;
}
.quiz__frame {
  position: absolute; inset: clamp(12px, 1.4vw, 20px); z-index: 1; pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--nm-radius-md);
}
.quiz__frame span { position: absolute; width: 18px; height: 18px; color: rgba(255, 255, 255, .32); }
.quiz__frame span::before, .quiz__frame span::after { content: ""; position: absolute; background: currentColor; }
.quiz__frame span::before { width: 100%; height: 1.5px; }
.quiz__frame span::after  { height: 100%; width: 1.5px; }
.quiz__frame span:nth-child(1) { top: -1px; left: -1px; }
.quiz__frame span:nth-child(2) { top: -1px; right: -1px; }
.quiz__frame span:nth-child(2)::before, .quiz__frame span:nth-child(2)::after { right: 0; }
.quiz__frame span:nth-child(3) { bottom: -1px; left: -1px; }
.quiz__frame span:nth-child(3)::before, .quiz__frame span:nth-child(3)::after { bottom: 0; }
.quiz__frame span:nth-child(4) { bottom: -1px; right: -1px; }
.quiz__frame span:nth-child(4)::before, .quiz__frame span:nth-child(4)::after { bottom: 0; right: 0; }

.quiz__inner { position: relative; z-index: 2; width: 100%; max-width: 860px; margin-inline: auto; }
/* атрибут hidden должен побеждать display у .nm-btn/.quiz__back и т.п. */
.quiz [hidden] { display: none !important; }

/* -------------------------------------------------- эйбрау */
.quiz__eyebrow {
  display: flex; justify-content: center; align-items: center; gap: .6em; margin: 0 0 clamp(16px, 1.8vw, 22px);
  font-size: clamp(.72rem, .95vw, .85rem); font-weight: 800; letter-spacing: .22em;
  text-transform: uppercase; color: var(--nm-orange); text-align: center;
}
.quiz__eyebrow::before, .quiz__eyebrow::after { content: ""; width: 26px; height: 2px; background: var(--nm-orange); border-radius: 2px; }

/* -------------------------------------------------- карточка/экраны */
.quiz__card { position: relative; height: clamp(496px, 42vw, 560px);
  overflow: clip; overflow-clip-margin: 50px; }  /* clip вместо hidden — тень/свечение кнопок не обрезается */
.quiz__screen { position: absolute; inset: 0; display: none; flex-direction: column; justify-content: center; }
.quiz__screen.is-active { display: flex; animation: quiz-fade .45s cubic-bezier(.19, .9, .22, 1); }
.quiz__screen[data-screen="question"] { justify-content: flex-start; padding-top: clamp(2px, .8vw, 10px); }
@keyframes quiz-fade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---- старт ---- */
.quiz__screen--start { text-align: center; }
.quiz__title { margin: 0 0 clamp(18px, 2vw, 26px); font-weight: 800; text-transform: uppercase;
  letter-spacing: -.02em; line-height: 1.02; font-size: clamp(2.3rem, 5.2vw, 4.2rem); color: #fff; }
.quiz__title em { font-style: normal; color: var(--nm-orange); }
.quiz__lead { margin: 0 auto clamp(28px, 3.2vw, 40px); max-width: 62ch;
  color: rgba(255, 255, 255, .74); line-height: 1.7; font-size: clamp(1rem, 1.15vw, 1.12rem); }
.quiz__lead b { color: #fff; font-weight: 700; }
.quiz__cta { align-self: center; font-size: clamp(1rem, 1.2vw, 1.1rem); padding: 1em 2em; }

/* ---- вопрос ---- */
.quiz__qhead { display: flex; align-items: center; gap: clamp(16px, 2vw, 26px); margin-bottom: clamp(12px, 1.6vw, 18px); }
.quiz__qnum { flex: none; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .04em;
  color: var(--nm-orange); font-size: clamp(.86rem, 1.05vw, 1rem); }
.quiz__progress { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.quiz__progress-bar { display: block; height: 100%; width: 0; border-radius: 3px;
  background: linear-gradient(90deg, #f23500, #ff6a1a); transition: width .5s cubic-bezier(.19, .9, .22, 1); }
.quiz__question { margin: 0 0 clamp(10px, 1.4vw, 15px); font-weight: 800; letter-spacing: -.01em;
  line-height: 1.15; font-size: clamp(1.22rem, 2.2vw, 1.85rem); color: #fff; }
.quiz__options { display: grid; gap: clamp(6px, .8vw, 9px); }
.quiz__opt {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; cursor: pointer;
  padding: clamp(10px, 1.1vw, 13px) clamp(16px, 1.7vw, 22px); border-radius: var(--nm-radius-sm); font-family: inherit;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .14); color: #fff;
  font-weight: 600; font-size: clamp(.96rem, 1.1vw, 1.06rem); line-height: 1.35;
  transition: border-color .22s ease, background .22s ease, transform .18s ease;
}
.quiz__opt-mark { flex: none; width: 30px; height: 30px; border-radius: var(--nm-radius-sm); display: grid; place-items: center;
  font-weight: 800; font-size: .9rem; color: var(--nm-orange); background: rgba(242, 53, 0, .14);
  border: 1px solid rgba(242, 53, 0, .3); transition: all .22s ease; }
.quiz__opt:not(:disabled):hover { border-color: var(--nm-border-glow); background: rgba(242, 53, 0, .08); transform: translateX(3px); }
.quiz__opt:disabled { cursor: default; }
.quiz__opt.is-correct { border-color: #34c07a; background: rgba(52, 192, 122, .16); }
.quiz__opt.is-correct .quiz__opt-mark { color: #fff; background: #34c07a; border-color: #34c07a; }
.quiz__opt.is-wrong { border-color: #e5484d; background: rgba(229, 72, 77, .14); }
.quiz__opt.is-wrong .quiz__opt-mark { color: #fff; background: #e5484d; border-color: #e5484d; }
/* промежуточное сообщение */
.quiz__interlude { margin: clamp(10px, 1.2vw, 14px) 0 0; padding: clamp(10px, 1.1vw, 13px) clamp(16px, 1.8vw, 22px);
  border-radius: var(--nm-radius-sm); border-left: 4px solid var(--nm-orange); background: rgba(242, 53, 0, .1);
  color: #fff; font-size: clamp(.9rem, 1vw, .98rem); line-height: 1.4; }
.quiz__interlude b { color: var(--nm-orange); }
.quiz__qfoot { display: flex; align-items: center; gap: 12px;
  min-height: clamp(42px, 3.2vw, 48px); margin-top: clamp(10px, 1.4vw, 15px); }
.quiz__back {
  display: inline-flex; align-items: center; gap: .5em; cursor: pointer; font-family: inherit;
  padding: .8em 1.4em; border-radius: var(--nm-radius-sm); background: transparent; color: rgba(255, 255, 255, .8);
  border: 1px solid rgba(255, 255, 255, .2); font-weight: 600; font-size: clamp(.92rem, 1.05vw, 1rem);
  transition: border-color .2s ease, color .2s ease;
}
.quiz__back:hover { border-color: var(--nm-orange); color: var(--nm-orange); }
.quiz__back svg { width: 16px; height: auto; }
.quiz__next { margin-left: auto; }

/* ---- результат ---- */
.quiz__screen--result { text-align: center; }
.quiz__badge {
  align-self: center; display: inline-flex; align-items: center; gap: .55em; margin: 0 0 clamp(20px, 2.4vw, 30px);
  padding: .6em 1.3em; border-radius: var(--nm-radius-pill);
  background: linear-gradient(120deg, #ff6a1a, #f23500); color: #fff; box-shadow: var(--nm-glow);
  font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: clamp(.78rem, .95vw, .88rem);
}
.quiz__score { font-weight: 800; line-height: .9; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
  font-size: clamp(3.4rem, 7vw, 6rem); color: var(--nm-coral); margin: 0 0 .1em; }
.quiz__score span { color: rgba(255, 255, 255, .5); font-size: .4em; }
.quiz__result-cap { margin: 0 0 clamp(18px, 2vw, 26px); color: rgba(255, 255, 255, .6);
  font-size: clamp(.85rem, 1vw, .95rem); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.quiz__result-title { margin: 0 0 clamp(12px, 1.4vw, 18px); font-weight: 800; letter-spacing: -.01em;
  line-height: 1.14; text-transform: uppercase; font-size: clamp(1.5rem, 2.8vw, 2.3rem); color: #fff; }
.quiz__result-text { margin: 0 auto clamp(26px, 3vw, 38px); max-width: 56ch;
  color: rgba(255, 255, 255, .74); line-height: 1.65; font-size: clamp(1rem, 1.15vw, 1.12rem); }
.quiz__restart {
  align-self: center; display: inline-flex; align-items: center; gap: .6em; cursor: pointer; font-family: inherit;
  padding: .85em 1.7em; border-radius: var(--nm-radius-sm); background: transparent; color: #fff;
  border: 1px solid rgba(255, 255, 255, .22); font-weight: 600; font-size: clamp(.95rem, 1.1vw, 1.02rem);
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.quiz__restart:hover { border-color: var(--nm-orange); color: var(--nm-orange); }

/* ------------------------------------------------------------- появление */
.js .quiz [data-io] { opacity: 0; transform: translateY(24px); }
.js .quiz [data-io].io-in { opacity: 1; transform: none;
  transition: opacity .7s ease, transform .8s cubic-bezier(.19, .9, .22, 1); }

@media (max-width: 640px) {
  .quiz__card { height: auto; min-height: 0; overflow: visible; }
  .quiz__screen { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  .js .quiz [data-io] { opacity: 1; transform: none; }
  .quiz__screen.is-active { animation: none; }
}
