/* =====================================================================
   MINDAURA — MCQ / IQ Test v2.5.0 (Loveable IqTest.tsx Exact Match)
   ===================================================================== */

/* ── 1. Page shell — hide WP header/footer when test is active ─────────── */
body.xfm-active #masthead,
body.xfm-active .site-header,
body.xfm-active header.site-header,
body.xfm-active .elementor-location-header,
body.xfm-active [data-elementor-type="header"] { display: none !important; }
body.xfm-active #colophon,
body.xfm-active .site-footer,
body.xfm-active footer.site-footer,
body.xfm-active .elementor-location-footer,
body.xfm-active [data-elementor-type="footer"],
body.xfm-active footer { display: none !important; }
html.xfm-active { margin-top: 0 !important; }
#wpadminbar { position: fixed !important; }
body.xfm-active { background: #f8f9fc !important; margin: 0 !important; }

/* v2.5.5: Remove the outer .xform-container padding/background that creates
   the visible gap above and below the test on the WP page. */
body.xfm-active .xform-container {
  padding: 0 !important;
  background: transparent !important;
}

body.xfm-active #xform-single-container {
  background: #f8f9fc !important;
  min-height: 100vh;
  display: flex !important;
  flex-direction: column !important;
  overflow: visible !important;
  padding: 0 !important;
  margin: 0 !important;             /* v2.5.5: kills the base 20px auto margin */
  border-radius: 0 !important;      /* v2.5.5: kills the base 8px card radius */
  border: none !important;
  box-shadow: none !important;
}
body.xfm-active #xform-main {
  flex: 1; display: flex; flex-direction: column;
  background: transparent !important; padding: 0 !important;
  margin: 0 !important; max-width: 100% !important;
  border: none !important; box-shadow: none !important;
}
body.xfm-active .xform-test-container {
  flex: 1; display: flex; flex-direction: column;
  /* v2.5.6: Zero out the white-card padding/shadow/radius on the inner test wrapper */
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* ── 2. Sticky TopBar ─────────────────────────────────────────────────── */
.xfm-topbar {
  position: sticky; top: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid #e8eaf2;
}
.xfm-topbar__inner {
  max-width: 900px; margin: 0 auto;
  height: 60px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
/* Logo: actual image */
.xfm-topbar__logo-img {
  height: 32px !important; width: auto; display: block;
}
/* Timer pill — matches Loveable exactly */
.xfm-topbar__timer {
  display: inline-flex; align-items: center; gap: 5px;
  background: #f0f2f7; border-radius: 999px;
  padding: 6px 14px; font-size: 14px; font-weight: 600; color: #1a1d2e;
}
/* Thin teal progress strip */
.xfm-progress-strip { height: 3px; background: #e8eaf2; }
.xfm-progress-fill { height: 100%; background: #1a7a6e; transition: width .35s ease; }

/* ── 3. Main content area ─────────────────────────────────────────────── */
.xfm-main {
  flex: 1; max-width: 760px; margin: 0 auto; width: 100%;
  padding: 40px 24px 100px;
}

/* ── Step 0: Intro / Start ───────────────────────────────────────────── */
.xfm-intro-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.xfm-intro-card {
  background: #fff; border-radius: 20px;
  padding: 40px 40px 36px; max-width: 680px; width: 100%;
  box-shadow: 0 4px 32px rgba(26,29,46,.07);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
/* Remove top margin from intro content that comes from the DB */
.xfm-intro-content { width: 100%; margin-bottom: 28px; }
.xfm-intro-content h1, .xfm-intro-content h2 { margin-top: 0; }
.xfm-start-btn {
  width: 100%; max-width: 360px;
  background: #1a7a6e; color: #fff; border: none; border-radius: 12px;
  padding: 16px 32px; font-size: 16px; font-weight: 700; cursor: pointer;
  transition: background .18s, transform .12s;
}
.xfm-start-btn:hover { background: #155f55; transform: translateY(-2px); }

/* ── 4. Interstitial (full-screen) ────────────────────────────────────── */
.xfm-interstitial {
  position: fixed; inset: 0; z-index: 99999;
  background: #f8f9fc;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 24px; text-align: center;
}
.xfm-interstitial__icon {
  width: 112px; height: 112px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 32px; font-size: 52px; line-height: 1;
}
.xfm-interstitial__icon--speed { background: rgba(245,158,11,.1); }
.xfm-interstitial__icon--iq    { background: rgba(79,70,229,.08); }
.xfm-interstitial__title { font-size: 26px; font-weight: 800; color: #1a1d2e; line-height: 1.3; margin-bottom: 16px; max-width: 440px; }
.xfm-interstitial__title .xfm-highlight { color: #4f46e5; }
.xfm-interstitial__sub { font-size: 15px; color: #6b7280; line-height: 1.7; max-width: 420px; margin: 0 auto 36px; }
.xfm-interstitial__btn {
  width: 100%; max-width: 420px;
  background: #1a7a6e; color: #fff; border: none; border-radius: 14px;
  padding: 18px 32px; font-size: 16px; font-weight: 700; cursor: pointer;
  transition: background .18s, transform .12s;
}
.xfm-interstitial__btn:hover { background: #155f55; transform: translateY(-2px); }

/* ── 5. Visual questions (SVG prompt + image grid) ────────────────────── */
.xfm-visual {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 28px; align-items: start;
}
.xfm-visual__prompt {
  border-radius: 14px; border: 2px solid rgba(26,29,46,.7);
  background: #fff; overflow: hidden;
}
.xfm-visual__prompt svg,
.xfm-visual__prompt > * { width: 100%; height: auto; display: block; }
.xfm-visual__label { font-size: 13px; color: #6b7280; margin-bottom: 10px; text-align: center; }
.xfm-visual__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* Wide grid: text question above, full-width image grid below */
.xfm-visual__grid--wide { grid-template-columns: repeat(3, 1fr); max-width: 560px; margin: 0 auto; }
.xfm-visual-text { max-width: 760px; margin: 0 auto; }
.xfm-visual__option {
  background: #f0f2f7; border: 2px solid transparent;
  border-radius: 12px; padding: 12px 8px;
  display: flex; align-items: center; justify-content: center;
  min-height: 72px; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.xfm-visual__option:hover { border-color: #1a7a6e; background: rgba(26,122,110,.06); }
.xfm-visual__option.xfm-selected { border-color: #1a7a6e; background: rgba(26,122,110,.08); box-shadow: 0 0 0 3px rgba(26,122,110,.15); }
.xfm-visual__option input[type="radio"],
.xfm-visual__option input[type="checkbox"] { display: none; }
.xfm-visual__option img, .xfm-visual__option svg { max-width: 100%; height: auto !important; max-height: 80px; display: block; }

/* ── 6. Text question ────────────────────────────────────────────────── */
.xfm-question {
  font-size: 20px; font-weight: 700; color: #1a1d2e; line-height: 1.4;
  text-align: center; margin-bottom: 28px; letter-spacing: -.01em;
}
.xfm-question img { max-width: 100%; border-radius: 12px; margin: 0 auto 16px; display: block; }

/* ── 7. Text options — Loveable pill style ───────────────────────────── */
.xfm-options { display: flex; flex-direction: column; gap: 10px; }
.xfm-option {
  width: 100%; text-align: left;
  padding: 16px 20px; border-radius: 12px;
  border: 1.5px solid transparent;
  background: #eef0f7;
  cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 15px; font-weight: 500; color: #1a1d2e;
  transition: border-color .15s, background .15s;
  position: relative;
}
.xfm-option:hover { background: #e4e8f3; }
.xfm-option.xfm-selected { border-color: #1a7a6e; background: #e8f4f1; }
/* Hidden inputs */
.xfm-option input[type="radio"],
.xfm-option input[type="checkbox"] { display: none; }
/* Check circle — shown when selected */
.xfm-option__check {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: #1a7a6e;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
}
.xfm-option__check::after { content: "✓"; color: #fff; font-size: 12px; font-weight: 700; }
.xfm-option.xfm-selected .xfm-option__check { opacity: 1; }
/* Multi-select badge */
.xfm-multi-badge { font-size: 11px; font-weight: 600; color: #4f46e5; background: rgba(79,70,229,.08); border-radius: 999px; padding: 4px 12px; margin-bottom: 10px; display: inline-block; }

/* ── 8. Get My Results ───────────────────────────────────────────────── */
.xfm-submit-wrap { margin-top: 28px; }
.xfm-submit-btn {
  width: 100%; background: #1a7a6e; color: #fff; border: none; border-radius: 12px;
  padding: 17px 32px; font-size: 16px; font-weight: 700; cursor: pointer;
  transition: background .18s, transform .12s, opacity .15s;
}
.xfm-submit-btn:hover:not(:disabled) { background: #155f55; transform: translateY(-1px); }
.xfm-submit-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.xfm-submit-note { font-size: 12px; color: #9ca3af; text-align: center; margin-top: 10px; }

/* ── 9. Sticky bottom footer ─────────────────────────────────────────── */
.xfm-footer {
  position: sticky; bottom: 0; z-index: 100;
  background: #fff; border-top: 1px solid #e8eaf2;
}
.xfm-footer__inner {
  max-width: 900px; margin: 0 auto;
  padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.xfm-nav-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: #eef0f7; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #1a1d2e; line-height: 1;
  transition: background .15s, opacity .15s;
}
.xfm-nav-btn:hover:not(:disabled) { background: #dde0ee; }
.xfm-nav-btn:disabled { opacity: .3; cursor: not-allowed; }
.xfm-footer__counter { font-size: 15px; color: #1a1d2e; }
.xfm-footer__counter strong { font-weight: 700; }
.xfm-footer__counter span { color: #9ca3af; }

/* ── 10. Section loading ──────────────────────────────────────────────── */
.xfm-section-loading { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 24px; }
.xfm-section-loading__spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid #eef0f7; border-top-color: #1a7a6e; animation: xfm-spin 1s linear infinite; margin-bottom: 18px; }
@keyframes xfm-spin { to { transform: rotate(360deg); } }
.xfm-section-loading__title { font-size: 19px; font-weight: 700; color: #1a1d2e; margin-bottom: 6px; }
.xfm-section-loading__sub { font-size: 14px; color: #6b7280; margin-bottom: 22px; }
.xfm-section-loading__bar { width: 100%; max-width: 260px; height: 5px; background: #eef0f7; border-radius: 99px; overflow: hidden; }
.xfm-section-loading__fill { height: 100%; background: #1a7a6e; border-radius: 99px; transition: width .4s ease; }

/* ── 11. Error ───────────────────────────────────────────────────────── */
.xfm-error { color: #ef4444; font-size: 13px; text-align: center; padding: 8px 0; font-weight: 500; }

/* ── 12. Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .xfm-topbar__inner { padding: 0 14px; height: 52px; }
  .xfm-topbar__logo-img { height: 26px !important; }
  .xfm-main { padding: 24px 14px 90px; }
  .xfm-question { font-size: 17px; margin-bottom: 22px; }
  .xfm-visual { grid-template-columns: 1fr; gap: 16px; }
  .xfm-visual__grid { grid-template-columns: 1fr 1fr; }
  .xfm-option { padding: 14px 16px; font-size: 14px; }
  .xfm-footer__inner { padding: 10px 14px; }
  .xfm-interstitial__title { font-size: 22px; }
  .xfm-interstitial__icon { width: 88px; height: 88px; font-size: 40px; }
}
