/* ==========================================================
   Joint Wellness Quiz – Final v4.5
   Research Bridge · Dashboard · Apple Health Style
   ========================================================== */

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
  animation: fadeSlideIn 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.result-section {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 400ms ease, transform 400ms ease;
}
.result-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Smart Sticky CTA */
.sticky-cta {
  transform: translateY(110%);
  opacity: 0;
  transition: transform 280ms ease, opacity 280ms ease;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(226, 232, 240, 0.6);
  box-shadow: 0 -10px 36px rgba(15, 23, 42, 0.06);
}
.sticky-cta.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 280ms ease;
}

.loading-bar { transition: width 420ms ease; }

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(30, 58, 138, 0.14);
  transform: scale(0);
  animation: ripple-anim 480ms linear;
  pointer-events: none;
}
@keyframes ripple-anim {
  to { transform: scale(4.2); opacity: 0; }
}

/* Gauge */
.gauge-track {
  height: 10px;
  border-radius: 999px;
  background: #E2E8F0;
  overflow: hidden;
}
.gauge-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
  transition: width 1.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.gauge-fill.animate { width: 70%; }

/* Selected answer */
.answer-btn {
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, transform 100ms ease;
}
.answer-btn.selected {
  border-color: #1E3A8A !important;
  border-width: 2px !important;
  background-color: #EFF6FF !important;
  box-shadow: 0 0 0 1px #1E3A8A, 0 2px 8px rgba(30, 58, 138, 0.1);
}
.answer-btn .check-icon {
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 160ms ease, transform 160ms ease;
  color: #10B981;
}
.answer-btn.selected .check-icon {
  opacity: 1;
  transform: scale(1);
}

.icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #EFF6FF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 150ms ease;
}
.answer-btn.selected .icon-box { background: #DBEAFE; }

/* CTA subtle pulse */
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(249, 115, 22, 0.28); }
  50% { box-shadow: 0 4px 24px rgba(249, 115, 22, 0.45); }
}
.cta-pulse {
  animation: ctaPulse 4.5s ease-in-out infinite;
}

/* Highlight */
.highlight {
  background: linear-gradient(180deg, transparent 55%, #FEF08A 55%);
  padding: 0 2px;
}

html, body { overscroll-behavior-y: none; }

.answer-btn:focus-visible,
.cta-btn:focus-visible,
.faq-question:focus-visible {
  outline: 2px solid #1E3A8A;
  outline-offset: 2px;
}

/* Hero image with bottom gradient */
.hero-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
}
.hero-wrap::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 45%;
  background: linear-gradient(to bottom, transparent, rgba(248,250,252,0.75));
  pointer-events: none;
}
