/* =====================================================
   Oral Health Quiz — Frontend CSS v3.3
   Defaults match the reference amber/gold design.
   All values overridable via Elementor controls.
   ===================================================== */

*, *::before, *::after { box-sizing: border-box; }

/* ── Quiz root ───────────────────────────────────── */
.ohq-quiz {
  position: relative;
  width: 100%;
  background: #F9FAFB; /* light gray page bg — overridable */
}

/* ── Screens wrapper — overflow:hidden for slide ─── */
.ohq-screens-wrap {
  position: relative;
  overflow: hidden;
}

/* ── Inner centred column ───────────────────────── */
.ohq-inner {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* ── Screen base ────────────────────────────────── */
.ohq-screen {
  display: none;
  width: 100%;
  padding: 64px 24px;
  justify-content: center;
}
.ohq-screen.ohq-on {
  display: flex;
  align-items: flex-start;
}

/* ── Leaving screens (absolute, out of flow) ────── */
.ohq-screen.ohq-out-l,
.ohq-screen.ohq-out-r {
  display: flex !important;
  position: absolute !important;
  top: 0; left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 1;
}
.ohq-screen.ohq-in-r,
.ohq-screen.ohq-in-l {
  position: relative;
  z-index: 2;
}

/* ── Slide animations ───────────────────────────── */
@keyframes ohqSlideOutLeft  { from{opacity:1;transform:translateX(0)}   to{opacity:0;transform:translateX(-48px)} }
@keyframes ohqSlideOutRight { from{opacity:1;transform:translateX(0)}   to{opacity:0;transform:translateX(48px)} }
@keyframes ohqSlideInRight  { from{opacity:0;transform:translateX(48px)} to{opacity:1;transform:translateX(0)} }
@keyframes ohqSlideInLeft   { from{opacity:0;transform:translateX(-48px)} to{opacity:1;transform:translateX(0)} }
.ohq-out-l { animation: ohqSlideOutLeft  .3s cubic-bezier(.4,0,.2,1) both; }
.ohq-out-r { animation: ohqSlideOutRight .3s cubic-bezier(.4,0,.2,1) both; }
.ohq-in-r  { animation: ohqSlideInRight  .3s cubic-bezier(.4,0,.2,1) both; }
.ohq-in-l  { animation: ohqSlideInLeft   .3s cubic-bezier(.4,0,.2,1) both; }

/* ── Shake on error ─────────────────────────────── */
@keyframes ohqShake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-7px)} 40%{transform:translateX(7px)} 60%{transform:translateX(-4px)} 80%{transform:translateX(4px)} }
.ohq-shake { animation: ohqShake .4s ease; }

/* =====================================================
   PROGRESS BAR
   ===================================================== */
.ohq-prog-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  padding: 12px 24px;
  border-bottom: 1px solid #F3F4F6;
  transition: opacity .25s, transform .25s;
}
.ohq-prog-header.ohq-hide { opacity: 0; pointer-events: none; transform: translateY(-8px); }
.ohq-prog-inner {
  max-width: 680px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
}
.ohq-prog-track {
  flex: 1; height: 6px; background: #E5E7EB;
  border-radius: 99px; overflow: hidden;
}
.ohq-prog-fill {
  height: 100%; width: 0;
  background: #F59E0B; /* amber — overridable */
  border-radius: 99px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.ohq-prog-text {
  font-size: 12px; font-weight: 600;
  color: #6B7280; white-space: nowrap; flex-shrink: 0;
}
.ohq-back-ico {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 600; color: #6B7280;
  padding: 5px 8px; border-radius: 7px;
  transition: background .15s, color .15s; flex-shrink: 0;
}
.ohq-back-ico:hover { background: #F3F4F6; color: #1F2937; }

/* =====================================================
   WELCOME SCREEN
   ===================================================== */

/* Alignment classes (set by PHP prefix_class) */
.ohq-w-align-left   .ohq-welcome .ohq-inner { align-items: flex-start; text-align: left; }
.ohq-w-align-center .ohq-welcome .ohq-inner { align-items: center;     text-align: center; }
.ohq-w-align-right  .ohq-welcome .ohq-inner { align-items: flex-end;   text-align: right; }
/* Default: center */
.ohq-welcome .ohq-inner { align-items: center; text-align: center; }

.ohq-welcome-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(245,158,11,.12); color: #B45309;
  font-size: 11px; font-weight: 700; padding: 5px 14px;
  border-radius: 99px; margin-bottom: 22px;
  letter-spacing: .07em; text-transform: uppercase;
}

/* Hero icon animations */
.ohq-welcome-icon { line-height: 1; }
@keyframes ohqFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
@keyframes ohqPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }
@keyframes ohqSpin  { from{transform:rotate(0)} to{transform:rotate(360deg)} }
.ohq-anim-float { animation: ohqFloat 3s ease-in-out infinite; }
.ohq-anim-pulse { animation: ohqPulse 2s ease-in-out infinite; }
.ohq-anim-spin  { animation: ohqSpin 6s linear infinite; }

.ohq-quiz-title {
  font-size: 2.5rem; font-weight: 800;
  color: #1F2937; margin: 0 0 16px;
  line-height: 1.15; letter-spacing: -.025em;
}
.ohq-title-hl  { color: #F59E0B; }
.ohq-quiz-subtitle {
  font-size: 1rem; color: #4B5563;
  margin: 0 0 28px; max-width: 500px; line-height: 1.7;
}
.ohq-welcome-meta {
  display: flex; flex-wrap: wrap; gap: 18px;
  margin-bottom: 32px; justify-content: center;
}
.ohq-meta-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #6B7280; font-weight: 500; }
.ohq-meta-dot  { width: 7px; height: 7px; background: #F59E0B; border-radius: 50%; flex-shrink: 0; }
.ohq-footnote  { font-size: .78rem; color: #9CA3AF; margin-top: 14px; }

/* ── Start button ───────────────────────────────── */
.ohq-start-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; cursor: pointer; font-family: inherit;
  padding: 16px 44px; border-radius: 12px;
  font-size: 1rem; font-weight: 700; line-height: 1;
  background: #F59E0B; color: #fff;
  box-shadow: 0 4px 18px rgba(245,158,11,.4);
  transition: background .18s, transform .2s, box-shadow .2s;
}
.ohq-start-btn:hover {
  background: #D97706;
  transform: translateY(-3px);
  box-shadow: 0 8px 26px rgba(245,158,11,.42);
}

/* =====================================================
   QUESTION SCREEN
   ===================================================== */

/* Alignment via prefix_class — default center */
.ohq-question .ohq-inner               { align-items: center; text-align: center; }
.ohq-q-align-left  .ohq-question .ohq-inner { align-items: flex-start; text-align: left; }
.ohq-q-align-center .ohq-question .ohq-inner { align-items: center;    text-align: center; }
.ohq-q-align-right .ohq-question .ohq-inner  { align-items: flex-end;  text-align: right; }

.ohq-q-label {
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em;
  color: #F59E0B; margin: 0 0 12px;
}
.ohq-q-title {
  font-size: 1.6rem; font-weight: 800;
  color: #1F2937; margin: 0 0 28px;
  line-height: 1.3; letter-spacing: -.02em;
}
.ohq-q-subtitle {
  font-size: .88rem; color: #6B7280;
  margin: -16px 0 20px; line-height: 1.6;
}

/* =====================================================
   ANSWER OPTIONS
   ===================================================== */
.ohq-options {
  display: grid;
  grid-template-columns: 1fr; /* default 1-col */
  gap: 14px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

/* ── Option card ────────────────────────────────── */
/*
  Layout: [○ radio] [emoji] [label]   — reference exact
*/
.ohq-option {
  border: 1px solid #E5E7EB;
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  width: 100%;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color .18s, background .18s, transform .18s, box-shadow .18s;
}
.ohq-option:hover {
  border-color: #F59E0B;
  background: #FFFBEB;
  transform: translateY(-2px);
  box-shadow: 0 3px 12px rgba(245,158,11,.12);
}
.ohq-option.ohq-sel {
  border-color: #F59E0B;
  background: #FEF3C7;
}
@keyframes ohqSelPulse { 0%{transform:scale(1)} 45%{transform:scale(1.012)} 100%{transform:scale(1)} }
.ohq-option.ohq-sel { animation: ohqSelPulse .28s ease; }

/* Hidden real radio */
.ohq-real-radio { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }

/* ── Indicator — LEFT, always ───────────────────── */
.ohq-indicator {
  width: 20px; height: 20px; min-width: 20px;
  border-radius: 50%;
  border: 2px solid #D1D5DB;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  order: -1; /* always first regardless of HTML order */
  transition: border-color .18s, background .18s;
}
.ohq-indicator::after {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%; background: #fff;
  opacity: 0; transition: opacity .18s;
}
.ohq-option.ohq-sel .ohq-indicator { background: #F59E0B; border-color: #F59E0B; }
.ohq-option.ohq-sel .ohq-indicator::after { opacity: 1; }

/* ── Icon ───────────────────────────────────────── */
.ohq-opt-icon {
  font-size: 22px; line-height: 1; flex-shrink: 0;
  transition: transform .18s;
}
.ohq-option.ohq-sel .ohq-opt-icon { transform: scale(1.1); }

/* ── Option body ────────────────────────────────── */
.ohq-opt-body  { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ohq-opt-label { font-size: .92rem; font-weight: 600; color: #1F2937; line-height: 1.3; }
.ohq-opt-sub   { font-size: .75rem; color: #6B7280; line-height: 1.4; }
.ohq-option.ohq-sel .ohq-opt-label { color: #92400E; }

/* ── Icon position: top (vertical card) ─────────── */
.ohq-options.ohq-icon-top .ohq-option    { flex-direction: column; align-items: center; text-align: center; }
.ohq-options.ohq-icon-top .ohq-indicator { order: 0; position: absolute; top: 10px; right: 12px; }
.ohq-options.ohq-icon-top .ohq-opt-body  { align-items: center; }

/* ── Text input ─────────────────────────────────── */
.ohq-text-wrap { width: 100%; max-width: 520px; }
.ohq-input {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid #E5E7EB; border-radius: 10px;
  font-size: .93rem; color: #111827; background: #fff;
  font-family: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.ohq-input:focus { border-color: #F59E0B; box-shadow: 0 0 0 3px rgba(245,158,11,.12); }
.ohq-input::placeholder { color: #9CA3AF; }

/* ── Info box ───────────────────────────────────── */
.ohq-info-box {
  display: flex; gap: 12px; align-items: flex-start;
  background: #EFF6FF; color: #1E40AF;
  border: 1px solid #BFDBFE;
  border-radius: 10px; padding: 13px 16px;
  margin-top: 22px; width: 100%; max-width: 560px; text-align: left;
}
.ohq-info-ico  { flex-shrink: 0; margin-top: 1px; }
.ohq-info-text { font-size: .81rem; margin: 0; line-height: 1.55; }

/* ── Question footer nav ────────────────────────── */
/*
  CENTERED by default — matches reference (Back button centred below options)
*/
.ohq-q-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;  /* ← CENTER (reference design) */
  margin-top: 28px;
  width: 100%;
}

.ohq-next-btn, .ohq-prev-btn {
  border: none; cursor: pointer; font-family: inherit; font-weight: 700;
  display: inline-flex; align-items: center; gap: 7px; line-height: 1;
  transition: background .16s, border-color .16s, transform .16s, box-shadow .16s;
}
.ohq-next-btn {
  padding: 13px 32px; border-radius: 10px; font-size: .9rem;
  background: #F59E0B; color: #fff;
}
.ohq-next-btn:hover { background: #D97706; transform: translateY(-2px); box-shadow: 0 4px 14px rgba(245,158,11,.3); }
.ohq-prev-btn {
  padding: 12px 22px; border-radius: 10px; font-size: .88rem;
  background: #fff; color: #6B7280;
  border: 1.5px solid #E5E7EB;
}
.ohq-prev-btn:hover { border-color: #9CA3AF; color: #374151; transform: translateY(-1px); }

/* =====================================================
   RESULT SCREEN
   ===================================================== */
.ohq-results .ohq-inner,
.ohq-thankyou .ohq-inner { align-items: center; text-align: center; }

/* Score ring */
.ohq-score-ring-wrap { position: relative; width: 100px; height: 100px; margin: 0 auto 20px; }
.ohq-ring-svg { width: 100%; height: 100%; }
.ohq-ring-fill { transition: stroke-dasharray 1.2s cubic-bezier(.4,0,.2,1), stroke .4s ease; }
.ohq-ring-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ohq-score-num { font-size: 26px; font-weight: 800; line-height: 1; }
.ohq-score-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #9CA3AF; font-weight: 600; }

/* Score bar */
.ohq-score-bar-wrap { width: 100%; max-width: 380px; margin: 0 auto 20px; }
.ohq-score-bar-head { text-align: center; margin-bottom: 10px; }
.ohq-score-bar-track { height: 10px; background: #F3F4F6; border-radius: 99px; overflow: hidden; }
.ohq-score-bar-fill  { height: 100%; width: 0; border-radius: 99px; transition: width 1.2s cubic-bezier(.4,0,.2,1); }

/* Result card */
.ohq-result-card {
  background: #fff; border-radius: 20px; padding: 36px;
  text-align: center; margin-bottom: 20px; width: 100%;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.ohq-tier-badge {
  display: inline-block; padding: 4px 14px; border-radius: 99px;
  font-size: 11px; font-weight: 700; margin-bottom: 14px;
  letter-spacing: .05em; text-transform: uppercase;
}
.ohq-result-icon  { font-size: 52px; line-height: 1; margin-bottom: 12px; display: block; }
.ohq-result-title { font-size: 1.5rem; font-weight: 800; margin: 0 0 12px; line-height: 1.2; letter-spacing: -.02em; }
.ohq-result-desc  { font-size: .93rem; color: #4B5563; margin: 0 0 18px; line-height: 1.7; }
.ohq-result-rec {
  border-radius: 10px; padding: 14px 18px; background: #F9FAFB;
  border-left: 3px solid #E5E7EB;
  text-align: left; font-size: .86rem; color: #374151;
  line-height: 1.65; margin-bottom: 20px;
}
.ohq-result-cta {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 16px 32px; border-radius: 12px;
  font-size: .95rem; font-weight: 700; color: #fff;
  text-decoration: none; border: none; cursor: pointer; font-family: inherit;
  transition: transform .18s, filter .18s, box-shadow .18s;
}
.ohq-result-cta:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 4px 18px rgba(0,0,0,.18); }

/* =====================================================
   LEAD FORM
   ===================================================== */
.ohq-lead-form {
  background: #fff; border-radius: 20px; padding: 32px 36px;
  width: 100%; box-shadow: 0 4px 20px rgba(0,0,0,.07);
  text-align: center; margin-bottom: 20px;
}
.ohq-lead-title { font-size: 1.2rem; font-weight: 800; color: #1F2937; margin: 0 0 10px; }
.ohq-lead-desc  { font-size: .87rem; color: #6B7280; margin: 0 0 22px; line-height: 1.55; }
.ohq-lead-fields { display: flex; flex-direction: column; gap: 11px; }
.ohq-submit-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px 32px; border-radius: 10px;
  font-size: .93rem; font-weight: 700; font-family: inherit;
  background: #F59E0B; color: #fff; border: none; cursor: pointer;
  transition: background .16s, transform .16s, box-shadow .16s;
}
.ohq-submit-btn:hover { background: #D97706; transform: translateY(-2px); box-shadow: 0 4px 14px rgba(245,158,11,.3); }
.ohq-submit-btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.ohq-privacy  { font-size: .74rem; color: #9CA3AF; margin: 4px 0 0; }
.ohq-skip-btn { background: none; border: none; cursor: pointer; font-family: inherit; font-size: .79rem; color: #9CA3AF; text-decoration: underline; margin-top: 2px; }

/* =====================================================
   THANK YOU
   ===================================================== */
.ohq-ty-circle {
  width: 88px; height: 88px; border-radius: 50%;
  background: #FEF3C7; color: #D97706;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 22px;
  animation: ohqPop .4s cubic-bezier(.175,.885,.32,1.275) both;
}
@keyframes ohqPop { from{transform:scale(0);opacity:0} to{transform:scale(1);opacity:1} }
.ohq-ty-title { font-size: 1.9rem; font-weight: 800; color: #1F2937; margin: 0 0 12px; }
.ohq-ty-msg   { font-size: .95rem; color: #6B7280; max-width: 400px; margin: 0 auto; line-height: 1.7; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 580px) {
  .ohq-options                     { grid-template-columns: 1fr !important; }
  .ohq-quiz-title                  { font-size: 1.9rem; }
  .ohq-q-title                     { font-size: 1.25rem; }
  .ohq-result-card, .ohq-lead-form { padding: 22px 18px; }
  .ohq-screen                      { padding: 48px 20px; }
}
