/* Match the journal's palette, typography, and square-edged components. */
.quiz-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
}

.quiz-gate :where(h2, h3, p) {
  margin: 0;
}

.quiz-gate :where(h2, h3) {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
}

.quiz-gate :where(button) {
  appearance: none;
  font-family: inherit;
}

.quiz-gate,
.quiz-gate *,
.quiz-gate *::before,
.quiz-gate *::after {
  border-radius: 0;
}

body.quiz-open {
  overflow: hidden;
}

body.quiz-open > :not(.quiz-gate):not(script):not(style) {
  pointer-events: none;
  user-select: none;
}

.quiz-gate.is-active {
  display: flex;
}

.quiz-gate__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 42, 53, 0.64);
}

.quiz-shell {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  background: #fff;
}

.quiz-screen {
  display: none;
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 30px;
}

.quiz-screen.is-active {
  display: block;
}

.quiz-kicker {
  color: #596865;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.7px;
  text-transform: uppercase;
}

.quiz-gate .quiz-title {
  margin-top: 12px;
  color: var(--ink);
  font-size: clamp(25px, 5.6vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.6px;
}

.quiz-gate .quiz-copy {
  margin-top: 14px;
  color: #515a5c;
  font-size: 15px;
  line-height: 1.65;
}

.quiz-primary-btn,
.quiz-secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 20px;
  padding: 17px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.quiz-primary-btn,
.quiz-primary-btn--accent {
  color: #fff;
  background: var(--navy);
}

.quiz-primary-btn:hover:not(:disabled) {
  background: #12333e;
}

.quiz-primary-btn:disabled {
  color: #fff;
  background: #70777a;
  cursor: not-allowed;
}

.quiz-secondary-btn {
  border-color: var(--navy);
  color: var(--navy);
  background: transparent;
}

.quiz-secondary-btn:hover {
  background: var(--sage);
}

.quiz-gate button:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

.quiz-step-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #cfd5d2;
}

.quiz-step-count {
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}

.quiz-step-select {
  color: #5c6668;
  font-size: 12px;
}

.quiz-question {
  color: var(--ink);
  font-size: clamp(24px, 5.4vw, 28px);
  line-height: 1.22;
  letter-spacing: -0.5px;
}

.quiz-options {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.quiz-option {
  width: 100%;
  min-height: 50px;
  padding: 14px 16px;
  border: 1px solid #cfd5d2;
  color: var(--ink);
  background: #fff;
  text-align: left;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  cursor: pointer;
}

.quiz-option:hover {
  border-color: var(--navy);
  background: var(--sage);
}

.quiz-option.is-selected {
  border-color: var(--red);
  color: var(--navy);
  background: var(--sage);
}

.quiz-options--multi .quiz-option {
  position: relative;
  padding-left: 46px;
}

.quiz-options--multi .quiz-option::before,
.quiz-options--multi .quiz-option::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.quiz-options--multi .quiz-option::before {
  left: 16px;
  width: 18px;
  height: 18px;
  border: 1px solid #70777a;
  background: #fff;
}

.quiz-options--multi .quiz-option::after {
  left: 22px;
  width: 6px;
  height: 10px;
  border-right: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: translateY(-62%) rotate(45deg);
}

.quiz-options--multi .quiz-option.is-selected::before {
  border-color: #34564c;
  background: #34564c;
}

.quiz-options--multi .quiz-option.is-selected::after {
  border-color: #fff;
}

.quiz-benefits {
  display: grid;
  gap: 0;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.quiz-benefits li {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  padding: 13px 16px;
  border-bottom: 1px solid #cfd5d2;
  color: var(--navy);
  background: var(--sage);
  font-size: 14px;
  line-height: 1.5;
}

.quiz-benefits li:last-child {
  border-bottom: 0;
}

.quiz-benefits li::before {
  content: '\2713';
  margin-right: 10px;
  color: #34564c;
  font-weight: 700;
}

.quiz-benefits li.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.quiz-screen--warning .quiz-title {
  color: var(--red);
}

.quiz-gate .is-hidden {
  display: none;
}

@media (max-width: 480px) {
  .quiz-screen {
    padding: 24px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-benefits li {
    transform: none;
    transition: none;
  }
}

/* Keep the selected product visible until the visitor chooses to continue. */
.quiz-result-product {
  display: block;
  width: 144px;
  height: 144px;
  margin: 12px auto 0;
  object-fit: contain;
}
@media (max-width: 480px) {
  .quiz-result-product { width: 116px; height: 116px; }
}
@media (max-height: 650px) {
  .quiz-screen--result { padding: 18px; }
  .quiz-result-product { width: 76px; height: 76px; margin-top: 8px; }
  .quiz-screen--result .quiz-title { margin-top: 8px; font-size: 20px; }
  .quiz-screen--result .quiz-benefits { margin-top: 12px; }
  .quiz-screen--result .quiz-benefits li { padding: 8px 12px; font-size: 13px; }
  .quiz-screen--result .quiz-primary-btn { min-height: 46px; margin-top: 12px; padding: 12px; }
}
