/* ================================================================
   Hakeem Quiz — Typeform-Style CSS
   Fonts: Cairo (display) + Tajawal (body) from Google Fonts
   RTL Arabic layout matching hakeeminsight.net design system
   ================================================================ */

/* Fonts loaded via wp_enqueue_style in class-quiz-frontend.php */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Warm UI Palette inspired by Landing Page snippet */
  --hq-screen-vh: 100vh;
  --hq-safe-side: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
  --hq-safe-bottom: max(16px, env(safe-area-inset-bottom));
  --hq-burgundy: #914936;
  /* Warm rust/brown */
  --hq-burgundy-dk: #7a3d2d;
  --hq-gold: #caa878;
  --hq-gold-lt: #ffe8b2;
  --hq-cream: #fff8f5;
  --hq-cream-dk: #fff3ec;
  --hq-dark: #473236;
  /* Deep brown text */
  --hq-muted: #806046;
  /* Softer brown text */
  --hq-white: #ffffff;
  --hq-orange: #9c4615;
  --hq-green: #27ae60;
  --hq-error: #b42318;
  --hq-bar-track: #e8e0d0;
  --hq-subtitle: #6b402e;
  --hq-shadow: 0 4px 20px rgba(85, 50, 38, 0.07);
  --hq-shadow-lg: 0 8px 30px rgba(85, 50, 38, 0.1);
  --hq-radius: 20px;
  --hq-transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  --hq-font-display: 'Cairo', 'Tajawal', sans-serif;
  --hq-font-body: 'Tajawal', sans-serif;
  --hq-space-1: 6px;
  --hq-space-2: 10px;
  --hq-space-3: 14px;
  --hq-space-4: 18px;
  --hq-space-5: 24px;
  --hq-space-6: 32px;
  --hq-space-7: 40px;
  --hq-button-height: 54px;
  --hq-button-x: 30px;
  --hq-button-radius: 18px;
  --hq-button-gap: 10px;
}

@supports (height: 100dvh) {
  :root {
    --hq-screen-vh: 100dvh;
  }
}

/* ── Selection ─────────────────────────────────────────────── */
#hq-quiz ::selection {
  background: color-mix(in srgb, var(--hq-gold) 35%, var(--hq-cream));
  color: var(--hq-dark);
}

/* ── Reset & Base ───────────────────────────────────────────── */
:where(#hq-quiz) :where(*, *::before, *::after) {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

#hq-quiz {
  direction: rtl;
  font-family: var(--hq-font-body);
  color: var(--hq-dark);
  background: linear-gradient(180deg, var(--hq-cream) 0%, var(--hq-cream-dk) 100%);
  position: relative;
  width: 100%;
  overflow: hidden;
  /* Full-viewport takeover */
  height: var(--hq-screen-vh);
  min-height: var(--hq-screen-vh);
}

/* ── Progress Bar ───────────────────────────────────────────── */
.hq-progress-bar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--hq-cream-dk);
  z-index: 100;
}

.hq-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hq-burgundy), var(--hq-gold));
  width: 0%;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Screens Wrapper ────────────────────────────────────────── */
.hq-screens-wrapper {
  position: relative;
  width: 100%;
  height: var(--hq-screen-vh);
  overflow: hidden;
}

/* ── Individual Screen ──────────────────────────────────────── */
.hq-screen {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  width: 100%;
  height: var(--hq-screen-vh);
  min-height: var(--hq-screen-vh);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hq-cream);
  transform: translateY(var(--hq-screen-vh));
  transition: transform var(--hq-transition);
  will-change: transform;
  overflow: hidden;
}

.hq-screen.is-active {
  transform: translateY(0);
  z-index: 10;
}

.hq-screen.is-above {
  transform: translateY(calc(var(--hq-screen-vh) * -1));
  z-index: 5;
}

/* Allow welcome screen to scroll */
.hq-screen--welcome {
  overflow-y: auto;
}

.hq-screen__inner {
  width: 100%;
  max-width: 640px;
  padding: var(--hq-space-7) var(--hq-space-6) calc(var(--hq-space-7) * 2);
  position: relative;
  z-index: 2;
}

/* ── Screen — Hint text ─────────────────────────────────────── */
.hq-hint {
  position: fixed;
  bottom: 24px;
  inset-inline-start: 24px;
  font-family: var(--hq-font-body);
  font-size: 12px;
  color: var(--hq-muted);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hq-screen.is-active .hq-hint {
  opacity: 1;
}

/* ── Welcome Screen ─────────────────────────────────────────── */
.hq-screen--welcome {
  align-items: flex-start;
  padding-top: 0;
  justify-content: center;
  overflow-y: auto;
}

.hq-screen--welcome .hq-screen__inner {
  padding: clamp(26px, 4vw, 50px) clamp(16px, 4vw, 32px) clamp(36px, 5vw, 58px);
  max-width: 960px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-align: center;
}

/* Reset margins on children — flex gap handles all spacing */
.hq-screen--welcome .hq-welcome__brand-wrap {
  margin-bottom: 0;
}

.hq-screen--welcome .hq-welcome__title {
  margin-bottom: 0;
}

.hq-screen--welcome .hq-welcome__subtitle {
  margin-bottom: 0;
}

.hq-screen--welcome .hq-welcome__desc--highlight {
  margin-bottom: 0;
}

.hq-welcome__brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: var(--hq-space-1);
  background: color-mix(in srgb, var(--hq-burgundy) 7%, var(--hq-cream));
  padding: var(--hq-space-1) var(--hq-space-4);
  border-radius: 30px;
  margin-bottom: 0;
}

.hq-welcome__brand-icon {
  font-size: 14px;
}

.hq-welcome__brand {
  font-family: var(--hq-font-body);
  font-size: 13px;
  color: var(--hq-burgundy);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.hq-welcome__title {
  font-family: var(--hq-font-display);
  font-size: clamp(34px, 7vw, 58px);
  font-weight: 800;
  color: var(--hq-burgundy);
  line-height: 1.2;
  margin-bottom: 0;
}

.hq-title-divider {
  height: 4px;
  width: 70px;
  background: linear-gradient(90deg, var(--hq-gold) 40%, var(--hq-gold-lt) 100%);
  margin: 0 auto;
  border-radius: 4px;
}

.hq-welcome__subtitle {
  font-family: var(--hq-font-display);
  font-size: clamp(20px, 3vw, 24px);
  color: var(--hq-subtitle);
  margin-bottom: var(--hq-space-5);
}

.hq-welcome__desc--highlight {
  font-family: var(--hq-font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--hq-burgundy-dk);
  margin-bottom: var(--hq-space-7);
  line-height: 1.6;
  max-width: 600px;
}

.hq-btn--large {
  padding-inline: calc(var(--hq-button-x) + 6px);
  min-height: 58px;
  font-size: 18px;
  width: auto;
  justify-content: center;
  margin-bottom: 0;
}

.hq-welcome__footer {
  font-family: var(--hq-font-body);
  font-size: 13px;
  color: var(--hq-muted);
  line-height: 1.6;
  text-align: center;
  opacity: 0.8;
}

.hq-welcome__heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hq-welcome__bg-deco {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

.hq-btn--cta-welcome {
  width: auto;
  padding-inline: 42px;
  min-height: 58px;
  font-size: 20px;
  border-radius: 20px;
  margin-bottom: 0;
}

.hq-landing {
  width: 100%;
  display: grid;
  gap: clamp(var(--hq-space-4), 3vw, var(--hq-space-6));
  position: relative;
  z-index: 2;
}

.hq-landing__hero {
  display: grid;
  justify-items: center;
  gap: var(--hq-space-4);
  max-width: 780px;
  margin: 0 auto;
}

.hq-landing__question {
  font-family: var(--hq-font-display);
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 700;
  line-height: 1.35;
  color: var(--hq-dark);
  margin: 0;
}

.hq-landing__intro {
  display: grid;
  gap: var(--hq-space-2);
  max-width: 720px;
  color: var(--hq-muted);
  font-family: var(--hq-font-body);
  font-size: clamp(16px, 2.2vw, 19px);
  line-height: 1.8;
}

.hq-landing__intro p,
.hq-landing__section p,
.hq-landing__list,
.hq-landing__note,
.hq-landing__time {
  margin: 0;
}

.hq-landing__cta-stack {
  display: grid;
  justify-items: center;
  gap: var(--hq-space-2);
  margin-top: var(--hq-space-1);
}

.hq-landing__time {
  font-family: var(--hq-font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--hq-muted);
  background: color-mix(in srgb, var(--hq-gold) 16%, var(--hq-white));
  border: 1px solid color-mix(in srgb, var(--hq-gold) 32%, var(--hq-white));
  border-radius: 999px;
  padding: var(--hq-space-1) var(--hq-space-3);
}

.hq-landing__section {
  width: min(100%, 720px);
  justify-self: center;
  text-align: right;
  background: color-mix(in srgb, var(--hq-white) 91%, var(--hq-cream));
  border: 1px solid color-mix(in srgb, var(--hq-burgundy) 10%, var(--hq-white));
  border-radius: 28px;
  box-shadow: 0 14px 34px rgba(85, 50, 38, 0.08);
  padding: clamp(var(--hq-space-5), 3vw, var(--hq-space-6));
  display: grid;
  gap: var(--hq-space-3);
}

.hq-landing__section--reveal {
  background: linear-gradient(145deg, color-mix(in srgb, var(--hq-white) 94%, var(--hq-cream)), color-mix(in srgb, var(--hq-gold) 12%, var(--hq-white)));
}

.hq-landing__section h2 {
  font-family: var(--hq-font-display);
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.3;
  color: var(--hq-burgundy);
  margin: 0;
}

.hq-landing__section p {
  font-family: var(--hq-font-body);
  font-size: 16px;
  line-height: 1.8;
  color: var(--hq-muted);
}

.hq-landing__list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--hq-space-2);
}

.hq-landing__list li {
  position: relative;
  padding-inline-start: 22px;
  font-family: var(--hq-font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--hq-dark);
}

.hq-landing__list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.72em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hq-gold);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--hq-gold) 18%, transparent);
}

.hq-landing__section p.hq-landing__closing {
  color: var(--hq-burgundy);
  font-weight: 700;
}

.hq-landing__note {
  width: min(100%, 820px);
  justify-self: center;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: right;
  color: var(--hq-muted);
  font-family: var(--hq-font-body);
  font-size: 14px;
  line-height: 1.7;
  background: color-mix(in srgb, var(--hq-cream) 74%, var(--hq-white));
  border-radius: 18px;
  padding: var(--hq-space-3) var(--hq-space-4);
}

.hq-landing__note strong {
  color: var(--hq-burgundy);
  font-family: var(--hq-font-display);
  white-space: nowrap;
}

.hq-landing .hq-btn--cta-welcome {
  justify-self: center;
}

/* Staggered entry animations — organic, non-uniform delays */
.hq-screen--welcome.is-active .hq-welcome__brand-wrap {
  animation: hq-fade-up 0.5s 0.06s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-screen--welcome.is-active .hq-welcome__heading {
  animation: hq-fade-up-lg 0.6s 0.14s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-screen--welcome.is-active .hq-welcome__desc--highlight {
  animation: hq-fade-up 0.55s 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-screen--welcome.is-active .hq-landing__intro,
.hq-screen--welcome.is-active .hq-landing__cta-stack {
  animation: hq-fade-up 0.5s 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-screen--welcome.is-active .hq-landing__section,
.hq-screen--welcome.is-active .hq-landing__note {
  animation: hq-fade-up 0.55s 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-screen--welcome.is-active .hq-landing__section--reveal {
  animation-delay: 0.52s;
}

.hq-screen--welcome.is-active .hq-btn--cta-welcome {
  animation: hq-fade-up 0.5s 0.58s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-screen--welcome.is-active .hq-welcome__footer {
  animation: hq-fade-up 0.45s 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Welcome wave */
.hq-screen__wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 1;
}

.hq-screen__wave svg {
  width: 100%;
  height: 80px;
  display: block;
}

/* ── Pillar Intro Screen ─────────────────────────────────────── */
.hq-screen--pillar-intro .hq-screen__inner,
.hq-pillar-intro__inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--hq-space-3);
}

.hq-pillar-intro__label {
  font-family: var(--hq-font-body);
  font-size: 14px;
  color: var(--hq-muted);
  letter-spacing: 1.5px;
}

.hq-pillar-intro__name {
  font-family: var(--hq-font-display);
  font-size: clamp(42px, 8vw, 60px);
  font-weight: 700;
  color: var(--hq-burgundy);
  line-height: 1;
}

.hq-pillar-intro__subtitle {
  font-family: var(--hq-font-body);
  font-size: 18px;
  color: var(--hq-muted);
  line-height: 1.6;
  max-width: 340px;
}

.hq-pillar-intro__icon {
  margin-top: 12px;
  opacity: 0.85;
}

.hq-screen--pillar-intro.is-active .hq-pillar-intro__name {
  animation: hq-scale-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-screen--pillar-intro.is-active .hq-pillar-intro__label,
.hq-screen--pillar-intro.is-active .hq-pillar-intro__subtitle {
  animation: hq-fade-up 0.5s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-screen--pillar-intro.is-active .hq-pillar-intro__icon {
  animation: hq-fade-up 0.5s 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Question Screen ─────────────────────────────────────────── */
.hq-question__inner {
  text-align: right;
  max-width: 800px;
  padding-top: 20px;
  padding-inline: clamp(20px, 3vw, 44px);
}

.hq-question__top-bar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: var(--hq-space-5);
}

.hq-pillar-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--hq-space-1);
  background: var(--hq-cream-dk);
  color: var(--hq-dark);
  font-family: var(--hq-font-body);
  font-size: 14px;
  padding: var(--hq-space-1) var(--hq-space-4);
  border-radius: 20px;
  font-weight: 500;
}

.hq-sep {
  opacity: 0.5;
  margin: 0 4px;
  font-size: 16px;
  color: var(--hq-muted);
}

.hq-arr {
  color: var(--hq-burgundy);
  font-weight: 700;
  font-size: 16px;
}

.hq-question__title {
  font-family: var(--hq-font-display);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  color: var(--hq-dark);
  line-height: 1.4;
  margin-bottom: var(--hq-space-6);
  text-align: right;
}

.hq-screen--question.is-active .hq-question__title {
  animation: hq-fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-screen--question.is-active .hq-answer-cards {
  animation: hq-fade-up 0.4s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-scale-note {
  display: none;
}

/* ── Answer Cards ─────────────────────────────────────────────── */
.hq-answer-cards {
  display: flex;
  gap: clamp(12px, 2vw, 18px);
  flex-direction: row-reverse;
  /* RTL: value 5 is rightmost visually */
  flex-wrap: nowrap;
  justify-content: center;
  max-width: 720px;
  margin: 0 auto;
}

.hq-answer-card {
  flex: 1;
  min-width: 0;
  max-width: 150px;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--hq-space-3);

  background: var(--hq-white);
  border: none;
  box-shadow: 0 2px 12px rgba(85, 50, 38, 0.06);
  border-radius: 20px;

  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.2s ease, color 0.2s ease;
  position: relative;
  overflow: hidden;
  font-family: var(--hq-font-body);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.hq-answer-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--hq-gold) 55%, white);
  outline-offset: 4px;
}

.hq-answer-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(85, 50, 38, 0.1);
  background: color-mix(in srgb, var(--hq-burgundy) 3%, var(--hq-white));
}

.hq-answer-card:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(85, 50, 38, 0.06);
}

.hq-answer-card.is-selected {
  background: var(--hq-burgundy);
  transform: scale(1.05);
  box-shadow:
    0 8px 32px rgba(145, 73, 54, 0.25),
    0 0 0 4px color-mix(in srgb, var(--hq-burgundy) 18%, transparent);
}

.hq-answer-card.is-selected .hq-answer-card__num,
.hq-answer-card.is-selected .hq-answer-card__label {
  color: var(--hq-white);
}

.hq-answer-card__num {
  font-family: var(--hq-font-display);
  font-size: 42px;
  font-weight: 700;
  color: var(--hq-burgundy);
  line-height: 1;
  transition: color 0.2s ease;
}

.hq-answer-card__label {
  font-size: 15px;
  color: var(--hq-muted);
  text-align: center;
  line-height: 1.3;
  transition: color 0.2s ease;
  overflow-wrap: break-word;
  word-break: break-word;
  padding: 0 4px;
}

.hq-answer-card__check {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  font-size: 16px;
  color: var(--hq-white);
  opacity: 0;
  z-index: 3;
  transition: opacity 0.2s ease;
}

.hq-answer-card.is-selected .hq-answer-card__check {
  opacity: 1;
}

/* Cascading Answer Card Entrance — accelerating stagger */
.hq-screen--question.is-active .hq-answer-card:nth-child(1) {
  animation: hq-fade-up 0.45s 0.10s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-screen--question.is-active .hq-answer-card:nth-child(2) {
  animation: hq-fade-up 0.45s 0.16s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-screen--question.is-active .hq-answer-card:nth-child(3) {
  animation: hq-fade-up 0.45s 0.20s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-screen--question.is-active .hq-answer-card:nth-child(4) {
  animation: hq-fade-up 0.45s 0.23s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-screen--question.is-active .hq-answer-card:nth-child(5) {
  animation: hq-fade-up 0.45s 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.hq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--hq-button-gap);
  font-family: var(--hq-font-display);
  font-size: 18px;
  font-weight: 700;
  min-height: var(--hq-button-height);
  padding: 0 var(--hq-button-x);
  border-radius: var(--hq-button-radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  position: relative;
  overflow: hidden;
}

.hq-btn:focus-visible,
.hq-inline-nav-btn:focus-visible,
.hq-nav-btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--hq-gold) 55%, white);
  outline-offset: 3px;
}

.hq-btn--primary {
  background: var(--hq-burgundy);
  color: var(--hq-white);
  border-color: var(--hq-burgundy);
  box-shadow: 0 4px 16px rgba(145, 73, 54, 0.2);
}

.hq-btn--primary:hover {
  background: var(--hq-burgundy-dk);
  border-color: var(--hq-burgundy-dk);
  box-shadow: 0 6px 20px rgba(145, 73, 54, 0.35);
  transform: translateY(-2px);
}

.hq-btn--primary:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 8px rgba(145, 73, 54, 0.2);
  transition-duration: 0.1s;
}

.hq-btn--outline {
  background: transparent;
  color: var(--hq-burgundy);
}

.hq-btn--outline:hover {
  background: color-mix(in srgb, var(--hq-burgundy) 8%, var(--hq-cream));
}

.hq-btn--outline:active {
  transform: scale(0.97);
  transition-duration: 0.1s;
}

.hq-btn--full {
  width: 100%;
  justify-content: center;
}

.hq-btn__arrow {
  font-size: 20px;
  transition: transform 0.2s ease;
}

.hq-btn:hover .hq-btn__arrow {
  transform: translateX(-4px);
}

/* Loading spinner */
.hq-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: hq-spin 0.7s linear infinite;
}

@keyframes hq-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Email Gate Screen ───────────────────────────────────────── */
.hq-email__inner {
  text-align: center;
  max-width: 480px;
}

.hq-email-panel {
  background: color-mix(in srgb, var(--hq-white) 90%, var(--hq-cream));
  border: 1px solid color-mix(in srgb, var(--hq-burgundy) 10%, var(--hq-white));
  box-shadow: var(--hq-shadow-lg);
  border-radius: 28px;
  position: relative;
  z-index: 2;
  margin: 0 auto;
  max-width: 540px;
  padding: var(--hq-space-7) var(--hq-space-6);
}

.hq-email__check {
  display: flex;
  justify-content: center;
  margin-bottom: var(--hq-space-5);
}

.hq-email__checkmark {
  display: block;
  margin: 0 auto;
}

/* SVG animated checkmark */
.hq-checkmark__circle {
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  stroke-width: 2;
  stroke: var(--hq-green);
  fill: none;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s;
}

.hq-checkmark__check {
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  transition: stroke-dashoffset 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.6s;
}

.hq-screen--email.is-active .hq-checkmark__circle {
  stroke-dashoffset: 0;
}

.hq-screen--email.is-active .hq-checkmark__check {
  stroke-dashoffset: 0;
}

.hq-email__title {
  font-family: var(--hq-font-display);
  font-size: clamp(28px, 4vw, 32px);
  font-weight: 700;
  color: var(--hq-burgundy);
  margin-bottom: var(--hq-space-2);
}

.hq-email__subtitle {
  font-family: var(--hq-font-body);
  font-size: 18px;
  color: var(--hq-muted);
  margin-bottom: var(--hq-space-5);
  line-height: 1.6;
}

.hq-email__form {
  text-align: right;
}

.hq-email__submit {
  margin-top: var(--hq-space-2);
}

.hq-form__group {
  margin-bottom: var(--hq-space-4);
}

.hq-form__label {
  display: block;
  font-family: var(--hq-font-body);
  font-size: 14px;
  color: var(--hq-muted);
  margin-bottom: var(--hq-space-1);
  font-weight: 500;
}

.hq-form__input {
  width: 100%;
  height: 54px;
  background: var(--hq-white);
  border: 1.5px solid rgba(145, 73, 54, 0.15);
  border-radius: 18px;
  padding: 0 var(--hq-space-5);
  font-family: var(--hq-font-body);
  font-size: 16px;
  color: var(--hq-dark);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.hq-form__input:focus {
  border-color: var(--hq-burgundy);
  box-shadow: 0 0 0 4px rgba(145, 73, 54, 0.1);
}

.hq-form__input.is-error {
  border-color: var(--hq-error);
  animation: hq-shake 0.4s ease;
}

.hq-form__error {
  display: block;
  font-size: 12px;
  color: var(--hq-error);
  margin-top: var(--hq-space-1);
  min-height: 16px;
}

@keyframes hq-shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-6px);
  }

  40% {
    transform: translateX(6px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }
}

.hq-email__privacy {
  display: block;
  font-size: 12px;
  color: var(--hq-muted);
  text-align: center;
  margin-top: var(--hq-space-4);
}

/* ── Results Screen ──────────────────────────────────────────── */
.hq-screen--results {
  transform: translateY(var(--hq-screen-vh));
  height: auto;
  min-height: var(--hq-screen-vh);
  align-items: flex-start;
  overflow-y: auto;
}

.hq-screen--results.is-active {
  overflow-y: auto;
}

.hq-results__inner {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: var(--hq-space-7) var(--hq-space-6) calc(var(--hq-space-7) * 2);
  text-align: right;
}

.hq-results__header {
  margin-bottom: var(--hq-space-7);
  animation: hq-fade-up-lg 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-results__brand {
  font-size: 13px;
  color: var(--hq-muted);
  margin-bottom: var(--hq-space-1);
}

.hq-results__title {
  font-family: var(--hq-font-display);
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 700;
  color: var(--hq-burgundy);
  line-height: 1.2;
  margin-bottom: var(--hq-space-1);
  overflow-wrap: break-word;
}

.hq-results__name {
  color: var(--hq-dark);
}

.hq-results__subtitle {
  font-size: 16px;
  color: var(--hq-muted);
  line-height: 1.6;
}

/* ── Radar Chart ─────────────────────────────────────────────── */
.hq-results__radar-wrap {
  display: flex;
  justify-content: center;
  margin: 0 auto var(--hq-space-7);
  animation: hq-fade-up 0.6s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-radar-chart {
  width: 280px;
  height: 280px;
  position: relative;
}

.hq-radar-chart svg {
  overflow: visible;
}

/* ── Score Bars ──────────────────────────────────────────────── */
.hq-results__bars {
  background: var(--hq-white);
  border-radius: var(--hq-radius);
  padding: var(--hq-space-6) var(--hq-space-6) var(--hq-space-5);
  box-shadow: var(--hq-shadow);
  margin-bottom: var(--hq-space-5);
  animation: hq-fade-up 0.6s 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-results__section-title {
  font-family: var(--hq-font-display);
  font-size: 22px;
  color: var(--hq-burgundy);
  margin-bottom: var(--hq-space-5);
  font-weight: 700;
}

.hq-bar-row {
  margin-bottom: var(--hq-space-4);
}

.hq-bar-row__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--hq-space-1);
}

.hq-bar-row__label {
  font-family: var(--hq-font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--hq-dark);
  display: flex;
  align-items: center;
  gap: var(--hq-space-1);
}

.hq-bar-row__label .hq-weakest-badge {
  font-family: var(--hq-font-body);
  font-size: 11px;
  background: var(--hq-orange);
  color: white;
  padding: 2px var(--hq-space-2);
  border-radius: 20px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(230, 126, 34, 0.3);
}

.hq-bar-row__score {
  font-family: var(--hq-font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--hq-muted);
}

.hq-bar-row__track {
  height: 8px;
  background: var(--hq-bar-track);
  border-radius: 4px;
  overflow: hidden;
}

.hq-bar-row__fill {
  height: 100%;
  width: 100%;
  background: var(--hq-burgundy);
  border-radius: 4px;
  transform: scaleX(var(--hq-bar-scale, 0));
  transform-origin: right center;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.hq-bar-row__fill--weakest {
  background: var(--hq-orange);
}

.hq-bar-row__fill--strong {
  background: var(--hq-green);
}

.hq-bar-row__status {
  font-size: 13px;
  color: var(--hq-muted);
  margin-top: var(--hq-space-1);
  line-height: 1.4;
}

/* ── Analysis Card ───────────────────────────────────────────── */
.hq-results__analysis {
  margin-bottom: var(--hq-space-7);
  animation: hq-fade-up 0.6s 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-analysis__card {
  background: var(--hq-white);
  border-radius: var(--hq-radius);
  border-right: 4px solid var(--hq-gold);
  padding: var(--hq-space-6);
  box-shadow: var(--hq-shadow);
}

.hq-analysis__badge {
  display: inline-block;
  font-family: var(--hq-font-display);
  font-size: 14px;
  color: var(--hq-burgundy);
  background: color-mix(in srgb, var(--hq-burgundy) 8%, var(--hq-cream));
  padding: 4px var(--hq-space-3);
  border-radius: 20px;
  margin-bottom: var(--hq-space-4);
  font-weight: 700;
}

.hq-analysis__pillar-name {
  font-family: var(--hq-font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--hq-burgundy);
  margin-bottom: var(--hq-space-4);
}

.hq-analysis__text {
  font-family: var(--hq-font-body);
  font-size: 17px;
  line-height: 2;
  color: var(--hq-dark);
  overflow-wrap: break-word;
}

.hq-analysis__text p {
  margin-bottom: 10px;
}

.hq-analysis__text p:last-child {
  margin-bottom: 0;
}

/* ── CTA Section ─────────────────────────────────────────────── */
.hq-results__cta {
  text-align: center;
  margin-bottom: var(--hq-space-7);
  animation: hq-fade-up 0.5s 0.46s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-results__cta-label {
  font-size: 13px;
  color: var(--hq-muted);
  margin-bottom: var(--hq-space-4);
  line-height: 1.6;
}

/* ── Inline Navigation (Next/Prev) ───────────────────────────── */
.hq-inline-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 720px);
  margin: clamp(28px, 4vw, 42px) auto 0;
  padding-inline: clamp(12px, 2.4vw, 24px);
  gap: var(--hq-space-3);
  animation: hq-fade-up 0.45s 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hq-inline-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--hq-space-1);
  min-width: 132px;
  min-height: 46px;
  padding: 0 var(--hq-space-5);
  background: var(--hq-white);
  color: var(--hq-muted);
  border: 1px solid rgba(145, 73, 54, 0.12);
  border-radius: 16px;
  font-family: var(--hq-font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(85, 50, 38, 0.05);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.hq-inline-nav-btn:hover:not(:disabled) {
  color: var(--hq-burgundy);
  background: rgba(145, 73, 54, 0.06);
  box-shadow: 0 3px 10px rgba(85, 50, 38, 0.08);
}

.hq-inline-nav-btn:active:not(:disabled) {
  transform: scale(0.97);
  transition-duration: 0.1s;
}

.hq-inline-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.hq-inline-nav-btn--next {
  color: var(--hq-burgundy);
  font-weight: 700;
  border-color: rgba(145, 73, 54, 0.2);
}

/* ── Navigation Arrows ───────────────────────────────────────── */
.hq-nav-arrows {
  position: fixed;
  bottom: calc(var(--hq-safe-bottom) + 8px);
  inset-inline-end: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 50;
}

.hq-nav-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hq-white);
  border: 1.5px solid rgba(160, 71, 71, 0.3);
  border-radius: 12px;
  color: var(--hq-burgundy);
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.hq-nav-btn:hover:not(:disabled) {
  background: var(--hq-burgundy);
  color: var(--hq-white);
  border-color: var(--hq-burgundy);
  transform: translateY(-2px);
}

.hq-nav-btn:active:not(:disabled) {
  transform: translateY(0);
}

.hq-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── Error Toast ─────────────────────────────────────────────── */
.hq-toast {
  position: fixed;
  bottom: 80px;
  right: 50%;
  transform: translateX(50%);
  background: var(--hq-dark);
  color: var(--hq-cream);
  font-family: var(--hq-font-body);
  font-size: 14px;
  padding: var(--hq-space-3) var(--hq-space-5);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(71, 50, 54, 0.25);
  z-index: 200;
  animation: hq-fade-up 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Keyframe Animations ─────────────────────────────────────── */
@keyframes hq-fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hq-fade-up-lg {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hq-scale-in {
  from {
    opacity: 0;
    transform: scale(0.88);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── Results wave ─────────────────────────────────────────────── */
.hq-screen__wave--results {
  position: relative;
  margin: 40px -32px -80px;
}

/* ── Responsive: Large Desktop ≥ 1200px ─────────────────────── */
@media (min-width: 1200px) {
  /* Welcome: wider hero and sections on large screens */
  .hq-screen--welcome .hq-screen__inner {
    max-width: 1060px;
    padding: clamp(32px, 4vw, 56px) clamp(24px, 4vw, 48px) clamp(40px, 5vw, 64px);
  }

  .hq-landing__hero {
    max-width: 860px;
  }

  .hq-landing__section {
    width: min(100%, 800px);
  }

  /* Questions: wider content area */
  .hq-question__inner {
    max-width: 860px;
  }

  .hq-answer-cards {
    max-width: 780px;
    gap: var(--hq-space-5);
  }

  .hq-answer-card {
    max-width: 160px;
  }

  .hq-answer-card__num {
    font-size: 46px;
  }

  .hq-answer-card__label {
    font-size: 16px;
  }

  /* Results: wider, more breathing room */
  .hq-results__inner {
    max-width: 720px;
    padding: var(--hq-space-7) var(--hq-space-6) calc(var(--hq-space-7) * 2);
  }

  .hq-radar-chart {
    width: 320px;
    height: 320px;
  }

  .hq-results__bars {
    padding: var(--hq-space-7) var(--hq-space-6) var(--hq-space-6);
  }

  .hq-analysis__card {
    padding: var(--hq-space-7);
  }

  .hq-analysis__text {
    font-size: 18px;
  }

  /* Pillar intros: larger typography */
  .hq-pillar-intro__name {
    font-size: 68px;
  }

  .hq-pillar-intro__subtitle {
    font-size: 20px;
    max-width: 400px;
  }
}

/* ── Responsive: Tablet 768-1024px ──────────────────────────── */
@media (max-width: 1024px) {
  .hq-question__inner {
    max-width: 720px;
    padding-inline: clamp(12px, 2.5vw, 24px);
  }

  .hq-answer-cards {
    gap: var(--hq-space-4);
    max-width: 100%;
  }

  .hq-results__inner {
    max-width: 600px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  /* Tablet welcome: tighter vertical rhythm */
  .hq-screen--welcome .hq-screen__inner {
    padding: var(--hq-space-5) var(--hq-space-5) var(--hq-space-6);
    max-width: 780px;
  }

  .hq-landing__hero {
    gap: var(--hq-space-3);
  }

  /* Tablet sections: side-by-side when landscape */
  .hq-landing__section {
    padding: var(--hq-space-5);
  }

  /* Tablet answer cards: comfortable size between phone and desktop */
  .hq-answer-card {
    max-width: 130px;
    border-radius: 18px;
  }

  .hq-answer-card__num {
    font-size: 36px;
  }

  .hq-answer-card__label {
    font-size: 13px;
  }

  /* Tablet email: centered panel with breathing room */
  .hq-email-panel {
    max-width: 480px;
    padding: var(--hq-space-6);
  }

  /* Tablet results: slightly wider */
  .hq-results__inner {
    max-width: 580px;
    padding: var(--hq-space-6) var(--hq-space-5) var(--hq-space-7);
  }

  .hq-radar-chart {
    width: 260px;
    height: 260px;
  }

  /* Tablet nav arrows: vertical stack on right, larger touch targets */
  .hq-nav-btn {
    width: 48px;
    height: 48px;
  }
}

/* Tablet landscape: welcome sections side-by-side */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
  .hq-screen--welcome .hq-screen__inner {
    max-width: 920px;
  }

  /* Two sections side-by-side */
  .hq-landing {
    grid-template-columns: 1fr;
  }

  .hq-landing__section {
    max-width: 100%;
  }
}

/* ── Responsive: Mobile ≤ 768px ─────────────────────────────── */
@media (max-width: 768px) {

  .hq-screen__inner {
    padding: var(--hq-space-5) var(--hq-space-4) calc(88px + var(--hq-safe-bottom));
    max-width: 100%;
  }

  .hq-screen--email,
  .hq-screen--pillar-intro {
    align-items: flex-start;
  }

  .hq-screen--question {
    align-items: center;
  }

  .hq-welcome__title {
    font-size: 36px;
  }

  .hq-welcome__subtitle {
    font-size: 20px;
  }

  .hq-screen--welcome .hq-screen__inner {
    gap: 0;
    padding: var(--hq-space-4) var(--hq-space-4) var(--hq-space-6);
  }

  .hq-btn--cta-welcome {
    width: 100%;
    max-width: 360px;
    justify-content: center;
    min-height: 54px;
    padding-inline: var(--hq-space-5);
    font-size: 18px;
    font-weight: 700;
    border-radius: 18px;
    box-shadow: 0 4px 16px rgba(145, 73, 54, 0.25);
  }

  .hq-landing {
    gap: var(--hq-space-4);
  }

  .hq-landing__hero {
    gap: var(--hq-space-3);
  }

  .hq-landing__question {
    font-size: 24px;
  }

  .hq-landing__intro {
    gap: var(--hq-space-1);
    font-size: 15px;
    line-height: 1.65;
  }

  .hq-landing__section {
    gap: var(--hq-space-2);
    padding: var(--hq-space-4);
    border-radius: 22px;
  }

  .hq-landing__section h2 {
    font-size: 22px;
  }

  .hq-landing__section p,
  .hq-landing__list li {
    font-size: 14px;
    line-height: 1.7;
  }

  .hq-landing__list {
    gap: var(--hq-space-2);
  }

  .hq-landing__note {
    padding: var(--hq-space-3) var(--hq-space-4);
    border-radius: 16px;
    font-size: 13px;
  }

  .hq-pillar-intro__name {
    font-size: 48px;
  }

  .hq-question__top-bar {
    margin-bottom: var(--hq-space-2);
  }

  .hq-pillar-pill {
    font-size: 12px;
    padding: 4px var(--hq-space-3);
  }

  .hq-question__title {
    font-size: 19px;
    line-height: 1.28;
    margin-bottom: var(--hq-space-2);
    max-width: none;
  }

  .hq-question__inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-inline: var(--hq-space-3);
    padding-top: var(--hq-space-4);
    padding-bottom: calc(var(--hq-space-7) + var(--hq-safe-bottom));
    transform: translateY(clamp(-96px, -10vh, -56px));
  }

  .hq-scale-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    direction: ltr;
    gap: var(--hq-space-2);
    max-width: 100%;
    margin: 0 auto var(--hq-space-2);
    padding-inline: var(--hq-space-1);
    font-family: var(--hq-font-body);
    font-size: 11px;
    color: var(--hq-muted);
  }

  .hq-scale-note__edge {
    direction: rtl;
    unicode-bidi: isolate;
    font-weight: 700;
    white-space: nowrap;
  }

  .hq-scale-note__edge--high {
    color: var(--hq-dark);
  }

  .hq-answer-cards {
    display: grid;
    direction: ltr;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--hq-space-2);
    max-width: 100%;
  }

  .hq-answer-card {
    direction: rtl;
    width: 100%;
    max-width: none;
    min-height: 76px;
    aspect-ratio: auto;
    gap: var(--hq-space-1);
    padding: var(--hq-space-2) var(--hq-space-1);
    border-radius: 16px;
  }

  .hq-answer-card__num {
    font-size: 26px;
  }

  .hq-answer-card__label {
    font-size: 10px;
    line-height: 1.2;
  }

  .hq-answer-card__check {
    top: 8px;
    inset-inline-start: auto;
    inset-inline-end: 8px;
    font-size: 14px;
  }

  .hq-email__title {
    font-size: 23px;
    line-height: 1.24;
    margin-bottom: 6px;
  }

  .hq-email__inner {
    max-width: 100%;
  }

  .hq-screen--email .hq-screen__inner {
    padding: var(--hq-space-2) var(--hq-space-3) calc(var(--hq-space-4) + var(--hq-safe-bottom));
  }

  .hq-email-panel {
    padding: var(--hq-space-4);
    border-radius: 22px;
  }

  .hq-email-panel,
  .hq-results__bars,
  .hq-analysis__card {
    box-shadow: 0 10px 30px rgba(85, 50, 38, 0.08);
  }

  .hq-email__check {
    margin-bottom: var(--hq-space-2);
  }

  .hq-email__checkmark {
    width: 56px;
    height: 56px;
  }

  .hq-email__subtitle {
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: var(--hq-space-3);
  }

  .hq-email__form {
    padding-inline: var(--hq-space-1);
  }

  .hq-form__group {
    margin-bottom: var(--hq-space-2);
  }

  .hq-form__label {
    font-size: 12px;
    margin-bottom: var(--hq-space-1);
    padding-inline: var(--hq-space-2);
  }

  .hq-form__input {
    height: 48px;
    padding-inline: var(--hq-space-4);
    border-radius: 16px;
    border-width: 1.25px;
  }

  .hq-form__error {
    margin-top: var(--hq-space-1);
    min-height: 12px;
  }

  .hq-email__submit {
    margin-top: var(--hq-space-2);
    min-height: 50px;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(145, 73, 54, 0.18);
  }

  .hq-email__privacy {
    margin-top: var(--hq-space-2);
    font-size: 11px;
    line-height: 1.45;
  }

  .hq-radar-chart {
    width: 188px;
    height: 188px;
  }

  .hq-results__inner {
    padding: var(--hq-space-5) var(--hq-space-4) var(--hq-space-7);
  }

  .hq-results__title {
    font-size: 24px;
    line-height: 1.16;
    margin-bottom: 4px;
  }

  .hq-results__brand {
    margin-bottom: 4px;
  }

  .hq-results__subtitle {
    font-size: 14px;
    line-height: 1.45;
  }

  .hq-results__header {
    margin-bottom: var(--hq-space-4);
  }

  .hq-results__radar-wrap {
    margin-bottom: var(--hq-space-4);
  }

  .hq-results__bars {
    padding: var(--hq-space-4);
    margin-bottom: var(--hq-space-4);
    border-radius: 22px;
  }

  .hq-results__section-title {
    font-size: 18px;
    margin-bottom: var(--hq-space-4);
  }

  .hq-bar-row {
    margin-bottom: var(--hq-space-3);
  }

  .hq-bar-row__header {
    margin-bottom: var(--hq-space-1);
  }

  .hq-bar-row__label {
    font-size: 15px;
    gap: var(--hq-space-1);
  }

  .hq-bar-row__score {
    font-size: 14px;
  }

  .hq-bar-row__status {
    font-size: 12px;
    line-height: 1.35;
    margin-top: var(--hq-space-1);
  }

  .hq-results__analysis {
    margin-bottom: var(--hq-space-5);
  }

  .hq-analysis__card {
    padding: var(--hq-space-4);
    border-radius: 22px;
    border-right-width: 3px;
  }

  .hq-analysis__badge {
    font-size: 12px;
    margin-bottom: var(--hq-space-2);
    padding: 4px var(--hq-space-2);
  }

  .hq-analysis__pillar-name {
    font-size: 20px;
    margin-bottom: var(--hq-space-2);
  }

  .hq-analysis__text {
    font-size: 15px;
    line-height: 1.8;
  }

  .hq-results__cta {
    margin-bottom: var(--hq-space-5);
  }

  .hq-results__cta-label {
    margin-bottom: var(--hq-space-3);
    font-size: 12px;
  }

  .hq-screen__wave--results {
    margin: 24px -16px -36px;
  }

  .hq-nav-arrows {
    right: 50%;
    bottom: calc(var(--hq-safe-bottom) + 8px);
    transform: translateX(50%);
    flex-direction: row;
    gap: var(--hq-space-2);
    padding: var(--hq-space-1);
    border: 1px solid color-mix(in srgb, var(--hq-burgundy) 10%, var(--hq-white));
    border-radius: 999px;
    background: color-mix(in srgb, var(--hq-white) 88%, var(--hq-cream));
    box-shadow: var(--hq-shadow);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .hq-nav-btn {
    width: 48px;
    height: 48px;
    font-size: 15px;
    border-radius: 999px;
  }

  .hq-inline-nav {
    width: 100%;
    margin-top: var(--hq-space-5);
    padding-inline: 0;
    gap: var(--hq-space-2);
  }

  .hq-hint {
    display: none;
  }

  .hq-inline-nav-btn {
    min-width: 0;
    flex: 1;
    min-height: 50px;
    padding: 0 var(--hq-space-3);
    border-radius: 18px;
  }
}

@media (max-width: 420px) {
  .hq-question__title {
    font-size: 17px;
    margin-bottom: var(--hq-space-2);
  }

  .hq-answer-cards {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    max-width: 100%;
  }

  .hq-answer-card {
    min-height: 72px;
    border-radius: 14px;
    gap: 4px;
    /* Ensure 44px minimum touch target even when visually smaller */
    min-width: 44px;
    padding: var(--hq-space-1) 2px;
  }

  .hq-answer-card__num {
    font-size: 24px;
  }

  .hq-answer-card__label {
    font-size: 10px;
    line-height: 1.15;
  }

  .hq-scale-note {
    margin-bottom: var(--hq-space-1);
    font-size: 10px;
    gap: var(--hq-space-1);
  }

  .hq-screen--email .hq-screen__inner {
    padding: var(--hq-space-1) var(--hq-space-2) calc(var(--hq-space-3) + var(--hq-safe-bottom));
  }

  .hq-email-panel {
    padding: var(--hq-space-3);
    border-radius: 18px;
  }

  .hq-email__checkmark {
    width: 50px;
    height: 50px;
  }

  .hq-email__title {
    font-size: 20px;
  }

  .hq-email__subtitle {
    font-size: 14px;
    margin-bottom: var(--hq-space-2);
  }

  .hq-results__inner {
    padding: var(--hq-space-4) var(--hq-space-3) var(--hq-space-6);
  }

  .hq-results__header {
    margin-bottom: var(--hq-space-3);
  }

  .hq-radar-chart {
    width: 176px;
    height: 176px;
  }

  .hq-results__bars {
    padding: var(--hq-space-3);
  }

  .hq-analysis__card,
  .hq-results__bars {
    border-radius: 20px;
  }

  .hq-analysis__text {
    font-size: 14px;
    line-height: 1.72;
  }

  .hq-btn {
    font-size: 16px;
    min-height: 50px;
    padding: 0 var(--hq-space-4);
    border-radius: 16px;
  }

  .hq-screen--welcome .hq-screen__inner {
    gap: 0;
    padding: var(--hq-space-3) var(--hq-space-3) var(--hq-space-6);
  }

  .hq-welcome__title {
    font-size: 30px;
  }

  .hq-landing__question {
    font-size: 21px;
  }

  .hq-landing__intro {
    font-size: 14px;
  }

  .hq-landing__section {
    padding: var(--hq-space-3);
    border-radius: 18px;
  }

  .hq-landing__section h2 {
    font-size: 20px;
  }

  .hq-landing__note {
    flex-direction: column;
    gap: var(--hq-space-1);
  }

  .hq-btn--cta-welcome {
    min-height: 52px;
    padding-inline: var(--hq-space-4);
    font-size: 16px;
  }

  .hq-inline-nav {
    margin-top: var(--hq-space-3);
    padding-inline: 0;
  }

}

@media (max-width: 900px) and (max-height: 560px) {
  .hq-screen__inner {
    padding-top: var(--hq-space-5);
    padding-bottom: calc(var(--hq-space-7) * 2 + var(--hq-safe-bottom));
  }

  .hq-screen--welcome .hq-screen__inner,
  .hq-screen--pillar-intro .hq-screen__inner {
    justify-content: center;
    gap: var(--hq-space-3);
  }

  .hq-screen--welcome .hq-screen__inner {
    justify-content: flex-start;
    gap: 0;
    padding-top: var(--hq-space-4);
    padding-bottom: var(--hq-space-5);
  }

  .hq-landing__section {
    padding: var(--hq-space-3);
  }

  .hq-pillar-intro__icon {
    display: none;
  }

  .hq-pillar-intro__name {
    font-size: 38px;
  }

  .hq-question__inner {
    transform: none;
    padding-top: var(--hq-space-3);
    padding-bottom: calc(var(--hq-space-5) + var(--hq-safe-bottom));
  }

  .hq-question__title {
    font-size: 18px;
    line-height: 1.3;
    margin-bottom: var(--hq-space-2);
  }

  .hq-answer-cards {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--hq-space-2);
  }

  .hq-answer-card {
    min-height: 64px;
    gap: var(--hq-space-1);
    padding: var(--hq-space-1) var(--hq-space-1);
  }

  .hq-answer-card__num {
    font-size: 22px;
  }

  .hq-answer-card__label {
    font-size: 10px;
  }

  /* Landscape email: compact panel */
  .hq-screen--email .hq-screen__inner {
    padding: var(--hq-space-2) var(--hq-space-3);
  }

  .hq-email-panel {
    padding: var(--hq-space-3) var(--hq-space-4);
    border-radius: 18px;
  }

  .hq-email__check {
    margin-bottom: var(--hq-space-1);
  }

  .hq-email__checkmark {
    width: 44px;
    height: 44px;
  }

  .hq-email__title {
    font-size: 20px;
    margin-bottom: 4px;
  }

  .hq-email__subtitle {
    font-size: 14px;
    margin-bottom: var(--hq-space-2);
  }

  .hq-form__group {
    margin-bottom: var(--hq-space-1);
  }

  .hq-form__input {
    height: 44px;
  }

  .hq-email__submit {
    margin-top: var(--hq-space-1);
    min-height: 46px;
  }

  .hq-email__privacy {
    margin-top: var(--hq-space-1);
  }

  /* Landscape: hide inline nav to save vertical space */
  .hq-inline-nav {
    margin-top: var(--hq-space-2);
  }

  .hq-inline-nav-btn {
    min-height: 40px;
  }

  .hq-scale-note {
    margin-bottom: var(--hq-space-1);
  }
}

@media (pointer: coarse) {
  .hq-hint {
    display: none;
  }
}

/* ── Print Styles (results screen) ──────────────────────────── */
@media print {
  #hq-quiz {
    height: auto;
    min-height: auto;
    overflow: visible;
    background: white;
  }

  .hq-screens-wrapper {
    height: auto;
    overflow: visible;
  }

  /* Hide everything except results */
  .hq-screen:not(.hq-screen--results) {
    display: none !important;
  }

  .hq-screen--results {
    position: static;
    transform: none;
    height: auto;
    min-height: auto;
    background: white;
  }

  /* Hide interactive elements */
  .hq-progress-bar,
  .hq-nav-arrows,
  .hq-toast,
  .hq-hint,
  .hq-results__cta,
  .hq-screen__wave,
  .hq-welcome__bg-deco {
    display: none !important;
  }

  .hq-results__inner {
    max-width: 100%;
    padding: 0;
  }

  /* Print-friendly colors */
  .hq-results__title {
    color: #3d1e14;
  }

  .hq-results__bars,
  .hq-analysis__card {
    box-shadow: none;
    border: 1px solid #d4c8be;
    break-inside: avoid;
  }

  .hq-analysis__card {
    border-right: 4px solid #caa878;
  }

  .hq-bar-row__fill {
    transition: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .hq-radar-chart svg {
    max-width: 240px;
    margin: 0 auto;
  }

  .hq-results__radar-wrap {
    break-inside: avoid;
  }

  /* Print footer with URL */
  .hq-results__inner::after {
    content: "hakeeminsight.net — اختبار الأمان الداخلي";
    display: block;
    text-align: center;
    font-size: 11px;
    color: #806046;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #e8e0d0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #hq-quiz *,
  #hq-quiz *::before,
  #hq-quiz *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hq-bar-row__fill {
    will-change: auto;
  }
}
