/* Scoped overrides keep the quiz on one scroll surface, even on short phones. */
.fitquest-onboarding-dialog {
  width: min(650px, calc(100% - 24px));
  max-height: 92dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-bottom: 96px;
}
.fitquest-onboarding-dialog .modal-body {
  overflow: visible;
  padding: 0;
}
.fitquest-onboarding-dialog .onboard-shell {
  min-height: 0;
  padding: 8px 24px 0;
}
.onboard-stage {
  min-width: 0;
  animation: fq-step-in 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.onboard-stage form {
  min-height: min(610px, calc(92dvh - 160px));
}
.onboard-stage .onboard-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding: 18px 0 max(16px, env(safe-area-inset-bottom));
  margin-top: auto;
  background: linear-gradient(transparent, #0b0b0d 18px);
  flex-shrink: 0;
}
.onboard-stage .onboard-actions .btn {
  min-width: 0;
  min-height: 52px;
}
.onboard-stage .onboard-actions .outline {
  flex: 0 0 auto;
}
.onboard-stage .onboard-step-copy h3 {
  font-size: clamp(32px, 9.5vw, 44px);
}
.onboard-stage .onboard-choice,
.onboard-stage .onboard-check {
  transition:
    border-color 180ms,
    background-color 180ms,
    transform 180ms;
}
.onboard-stage .onboard-choice:active,
.onboard-stage .onboard-check:active {
  transform: scale(0.98);
}
.onboard-stage .onboard-choice:has(input:checked)::after {
  animation: fq-choice-pop 240ms ease-out;
}
.fq-measure {
  margin: clamp(22px, 6dvh, 54px) 0 24px;
}
.onboard-stage .fq-measure input {
  width: min(210px, 65%);
  font-size: clamp(64px, 22vw, 92px);
}
.fq-ruler {
  position: relative;
  display: block;
  height: 80px;
  margin: 18px 0 12px;
  overflow: hidden;
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  border-radius: 12px;
  background: linear-gradient(90deg, #16131b, #20172b, #16131b);
}
.fq-ruler-track {
  position: absolute;
  pointer-events: none;
  inset: 20px 0;
  background:
    repeating-linear-gradient(90deg, #b5a4c8 0 1px, transparent 1px 80px),
    repeating-linear-gradient(90deg, #766780 0 1px, transparent 1px 16px);
  background-size:
    80px 40px,
    16px 24px;
  background-repeat: repeat-x;
}
.fitquest-onboarding-dialog .fq-ruler::after {
  display: none;
}
.fq-ruler input[type='range'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: ew-resize;
  touch-action: none;
  z-index: 2;
  opacity: 0.01;
}
.fq-ruler input[type='range']::-webkit-slider-runnable-track {
  height: 100%;
  background: transparent;
}
.fq-ruler input[type='range']::-moz-range-track {
  height: 100%;
  background: transparent;
}
.fq-ruler input[type='range']::-webkit-slider-thumb {
  width: 5px;
  height: 44px;
  margin-top: 18px;
  border: 0;
  border-radius: 5px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--lime);
  box-shadow: 0 0 16px #b6ff4580;
}
.fq-ruler input[type='range']::-moz-range-thumb {
  width: 5px;
  height: 44px;
  border: 0;
  border-radius: 5px;
  background: var(--lime);
  box-shadow: 0 0 16px #b6ff4580;
}
.fq-slider-thumb {
  position: absolute;
  top: 18px;
  left: var(--range-progress, 50%);
  z-index: 1;
  width: 6px;
  height: 44px;
  border-radius: 5px;
  background: var(--lime);
  box-shadow: 0 0 16px #b6ff4580;
  transform: translateX(-50%);
  pointer-events: none;
}
.fq-ruler:has(input[type='range']:focus-visible) {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}
.fq-measure-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.fq-measure-controls button {
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid #4d3b60;
  background: #1d1726;
  border-radius: 50%;
  color: var(--lime);
  font-size: 24px;
}
.fq-measure-controls small {
  font-size: 11px;
  line-height: 1.6;
}
.fq-ruler input[type='range']:focus-visible,
.fq-measure-controls button:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}
.onboard-stage .plan-exercise-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.plan-exercise-grid article {
  min-width: 0;
  overflow-wrap: anywhere;
}
/* Exercise media uses absolute children elsewhere: give each preview its own boundary. */
.onboard-stage .plan-exercise-thumb {
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  height: 140px;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #f5f5f6;
}
.plan-exercise-thumb .exercise-demo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.plan-exercise-thumb img,
.plan-exercise-thumb svg {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.plan-exercise-thumb .demo-play-label {
  position: absolute;
  z-index: 1;
  bottom: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 6px 2px;
  border-radius: 8px;
  background: #151518ed;
  color: #fff;
  font-size: 10px;
}
.plan-exercise-thumb:has(img:not([data-demo-loaded]):not([data-demo-unavailable]))::before {
  content: 'Carregando prévia…';
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding-bottom: 22px;
  color: #63576d;
  font-size: 11px;
  pointer-events: none;
}
.onboard-stage .fq-welcome-art {
  animation: fq-art-arrive 650ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes fq-art-arrive {
  from {
    opacity: 0;
    transform: translateY(18px) rotate(-4deg) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0) scale(1);
  }
}
.onboard-stage .onboard-week-plan article {
  min-width: 0;
  padding: 14px;
}
.onboard-week-plan article div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.onboard-plan .onboard-actions {
  margin-top: 24px;
}
.fq-progress-demo {
  overflow: hidden;
}
.fq-progress-demo svg {
  width: 100%;
  height: auto;
  display: block;
}
.fq-chart-line {
  stroke-dasharray: 1;
  animation: fq-chart-draw 1100ms 180ms ease-out both;
}
.fq-chart-dot {
  transform-box: fill-box;
  transform-origin: center;
  animation: fq-choice-pop 450ms 1100ms both;
}
.plan-loader-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  margin: 0 auto 24px;
}
.plan-loader-orbit .plan-loader-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 3px solid #483456;
  border-top-color: var(--lime);
  border-right-color: var(--lime);
  animation: fq-orbit 950ms linear infinite;
}
.plan-loader-orbit b {
  color: var(--lime);
  font: 48px var(--display);
}
.plan-loader-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 24px;
}
.plan-loader-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  animation: fq-loader-dot 900ms ease-in-out infinite alternate;
}
.plan-loader-dots i:nth-child(2) {
  animation-delay: 150ms;
}
.plan-loader-dots i:nth-child(3) {
  animation-delay: 300ms;
}
@keyframes fq-step-in {
  from {
    opacity: 0;
    transform: translateX(calc(20px * var(--step-direction, 1)));
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes fq-choice-pop {
  from {
    transform: scale(0.65);
    opacity: 0.4;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes fq-chart-draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes fq-orbit {
  to {
    transform: rotate(360deg);
  }
}
@keyframes fq-loader-dot {
  to {
    transform: translateY(-6px);
    opacity: 0.35;
  }
}
@media (max-width: 640px) {
  .fitquest-onboarding-dialog {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    min-height: 0;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .fitquest-onboarding-dialog .onboard-shell {
    padding: 8px 20px 0;
    min-height: 0;
  }
  .onboard-stage form {
    min-height: calc(100dvh - 166px);
  }
  .onboard-stage .onboard-actions {
    bottom: 0;
  }
}
@media (max-height: 650px) {
  .fq-measure {
    margin-top: 16px;
  }
  .onboard-stage .onboard-step-copy {
    margin-bottom: 12px;
  }
  .onboard-stage .onboard-progress {
    margin-bottom: 16px;
  }
  .onboard-stage .fq-notification-preview {
    margin: 24px 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .onboard-stage,
  .onboard-stage *,
  .onboard-stage *::after {
    animation: none !important;
    transition: none !important;
  }
  .fq-chart-line {
    stroke-dashoffset: 0;
  }
}
