/* ==========================================================================
   Axe Arena – motion pack for customer pages (booking wizard, services, pricing).
   • Works in every browser: cubic-bezier easing by default, a spring curve only
     where the browser supports linear() easing.
   • Reduced-motion users (e.g. Windows "Animation effects" off) still get short,
     gentle fades — only movement, scaling and staggering are removed.
   ========================================================================== */

:root {
  --axm-ease: cubic-bezier(.2, .8, .2, 1);
  --axm-back: cubic-bezier(.34, 1.45, .64, 1);          /* gentle overshoot, universally supported */
  --axm-spring: var(--axm-back);
  --axm-fast: 160ms;
  --axm-med: 320ms;
  --axm-slow: 560ms;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root { --axm-spring: linear(0, .053, .168, .313, .455, .586, .698, .789, .861, .916, .954, .98, .997, 1.007, 1.012, 1.014, 1.013, 1.009, 1.005, 1.002, 1); }
}

/* ── Wizard entrance ─────────────────────────────────────────────────── */
#axwiz-root { animation: axm-rise var(--axm-slow) var(--axm-ease) both; }
@keyframes axm-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes axm-fade { from { opacity: 0; } to { opacity: 1; } }

/* Step panels slide in the direction of travel */
#axwiz-root .axwiz-panel.active { animation: axm-next var(--axm-med) var(--axm-ease) both; }
#axwiz-root.axm-back .axwiz-panel.active { animation-name: axm-prev; }
@keyframes axm-next { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes axm-prev { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }

/* Stepper: active step pops, completed steps tick */
#axwiz-root .axwiz-step { transition: opacity var(--axm-med), transform var(--axm-med) var(--axm-spring); }
#axwiz-root .axwiz-step.active { animation: axm-pop var(--axm-slow) var(--axm-spring) both; }
@keyframes axm-pop { 0% { transform: scale(.9); } 60% { transform: scale(1.04); } 100% { transform: none; } }

/* ── Staggered items (index set by motion.js as --axm-i) ─────────────── */
.axm-in { animation: axm-item var(--axm-med) var(--axm-ease) both; animation-delay: calc(min(var(--axm-i, 0), 14) * 35ms); }
@keyframes axm-item { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

/* ── Cards: service, add-on, lane / chair / room ─────────────────────── */
#axwiz-root .axwiz-service-card, #axwiz-root .axwiz-addon-card, #axwiz-root .axwiz-lane-card {
  transition: transform var(--axm-med) var(--axm-spring), box-shadow var(--axm-med) var(--axm-ease), border-color var(--axm-fast), background-color var(--axm-fast);
}
@media (hover: hover) {
  #axwiz-root .axwiz-service-card:hover, #axwiz-root .axwiz-addon-card:hover, #axwiz-root .axwiz-lane-card:hover {
    transform: translateY(-4px); box-shadow: 0 14px 34px rgba(0, 0, 0, .14);
  }
  #axwiz-root .axwiz-service-card:hover img, #axwiz-root .axwiz-service-card:hover .axwiz-card-icon-wrap i { transform: scale(1.06); }
}
#axwiz-root .axwiz-service-card img, #axwiz-root .axwiz-card-icon-wrap i { transition: transform var(--axm-slow) var(--axm-ease); }
#axwiz-root .axwiz-service-card:active, #axwiz-root .axwiz-addon-card:active, #axwiz-root .axwiz-lane-card:active { transform: scale(.97); transition-duration: 90ms; }
#axwiz-root .axwiz-service-card.selected, #axwiz-root .axwiz-lane-card.selected { animation: axm-select var(--axm-slow) var(--axm-spring); }
@keyframes axm-select { 0% { transform: scale(.97); } 55% { transform: scale(1.02); } 100% { transform: none; } }
#axwiz-root .axwiz-service-card.selected .axwiz-card-check,
#axwiz-root .axwiz-service-card.selected .axwiz-cat-check,
#axwiz-root .axwiz-lane-card.selected .axwiz-lane-card-check { animation: axm-check var(--axm-med) var(--axm-spring) both; }
@keyframes axm-check { from { transform: scale(0) rotate(-25deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Calendar ────────────────────────────────────────────────────────── */
#axwiz-root .axwiz-cal-day { transition: background-color var(--axm-fast), color var(--axm-fast), transform var(--axm-med) var(--axm-spring), box-shadow var(--axm-fast); }
@media (hover: hover) { #axwiz-root .axwiz-cal-day:not(.disabled):not(.axwiz-cal-filler):hover { transform: translateY(-2px); } }
#axwiz-root .axwiz-cal-day.selected { animation: axm-day var(--axm-slow) var(--axm-spring); }
@keyframes axm-day { 0% { transform: scale(.85); } 60% { transform: scale(1.12); } 100% { transform: none; } }

/* ── Time slots ──────────────────────────────────────────────────────── */
#axwiz-root .axwiz-ts-pill { transition: background-color var(--axm-fast), color var(--axm-fast), border-color var(--axm-fast), transform var(--axm-med) var(--axm-spring), box-shadow var(--axm-fast); }
@media (hover: hover) { #axwiz-root .axwiz-ts-pill:hover { transform: translateY(-2px); } }
#axwiz-root .axwiz-ts-pill.axwiz-ts-selected { animation: axm-pop var(--axm-med) var(--axm-spring); box-shadow: 0 6px 18px rgba(0, 0, 0, .16); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
#axwiz-root .axwiz-btn-next, #axwiz-root .axwiz-btn-submit, #axwiz-root .axwiz-btn-back, #axwiz-root .axwiz-tip-btn {
  transition: transform var(--axm-fast) var(--axm-spring), box-shadow var(--axm-med), background-color var(--axm-fast), opacity var(--axm-fast);
}
@media (hover: hover) {
  #axwiz-root .axwiz-btn-next:hover, #axwiz-root .axwiz-btn-submit:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .18); }
  #axwiz-root .axwiz-btn-next:hover i.fa-arrow-right, #axwiz-root .axwiz-btn-next:hover i.fa-chevron-right { transform: translateX(4px); }
}
#axwiz-root .axwiz-btn-next i { transition: transform var(--axm-med) var(--axm-spring); }
#axwiz-root .axwiz-btn-next:active, #axwiz-root .axwiz-btn-submit:active, #axwiz-root .axwiz-btn-back:active, #axwiz-root .axwiz-tip-btn:active { transform: scale(.96); transition-duration: 80ms; }
#axwiz-root .axwiz-tip-btn--active { animation: axm-pop var(--axm-med) var(--axm-spring); }
#axwiz-root .axm-ripple { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .45); transform: scale(0); animation: axm-ripple .6s var(--axm-ease) forwards; pointer-events: none; }
@keyframes axm-ripple { to { transform: scale(4); opacity: 0; } }

/* ── Inputs ──────────────────────────────────────────────────────────── */
#axwiz-root .axwiz-input { transition: border-color var(--axm-fast), box-shadow var(--axm-med) var(--axm-ease), background-color var(--axm-fast); }
#axwiz-root .axwiz-input:focus { box-shadow: 0 0 0 4px rgba(99, 91, 255, .14); }
#axwiz-root .axwiz-step-err { animation: axm-shake .45s var(--axm-ease); }
@keyframes axm-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* ── Summary values flash when they change ───────────────────────────── */
.axm-flash { animation: axm-flash .9s var(--axm-ease); border-radius: 4px; }
@keyframes axm-flash { 0% { background-color: rgba(99, 91, 255, .28); } 100% { background-color: transparent; } }

/* ── Success screen ──────────────────────────────────────────────────── */
#axwiz-root .axwiz-success-wrap > * { animation: axm-item var(--axm-slow) var(--axm-ease) both; }
#axwiz-root .axwiz-success-wrap > *:nth-child(2) { animation-delay: .1s; }
#axwiz-root .axwiz-success-wrap > *:nth-child(3) { animation-delay: .2s; }
#axwiz-root .axwiz-success-wrap > *:nth-child(4) { animation-delay: .3s; }
#axwiz-root .axwiz-success-wrap > *:nth-child(n+5) { animation-delay: .4s; }
#axwiz-root .axwiz-success-icon { animation: axm-bounce .8s var(--axm-spring) both; }
@keyframes axm-bounce { 0% { transform: scale(0); } 60% { transform: scale(1.12); } 100% { transform: none; } }
.axm-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 999999; overflow: hidden; }
.axm-confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: axm-fall 2.2s var(--axm-ease) forwards; }
@keyframes axm-fall { to { transform: translate3d(var(--dx, 0), 105vh, 0) rotate(720deg); opacity: .2; } }

/* ── Service & pricing pages: reveal on scroll ───────────────────────── */
.axm-rv { opacity: 0; transform: translateY(22px); transition: opacity .6s var(--axm-ease), transform .7s var(--axm-ease); transition-delay: calc(min(var(--axm-i, 0), 8) * 70ms); }
.axm-rv.axm-on { opacity: 1; transform: none; }

/* ── Reduced motion: keep gentle fades, drop movement ────────────────── */
@media (prefers-reduced-motion: reduce) {
  #axwiz-root, #axwiz-root .axwiz-panel.active, #axwiz-root.axm-back .axwiz-panel.active, .axm-in,
  #axwiz-root .axwiz-success-wrap > *, #axwiz-root .axwiz-success-icon { animation: axm-fade 200ms ease both !important; animation-delay: 0s !important; }
  #axwiz-root .axwiz-step.active, #axwiz-root .axwiz-service-card.selected, #axwiz-root .axwiz-lane-card.selected, #axwiz-root .axwiz-cal-day.selected,
  #axwiz-root .axwiz-ts-pill.axwiz-ts-selected, #axwiz-root .axwiz-tip-btn--active, #axwiz-root .axwiz-step-err { animation: none !important; }
  #axwiz-root *:hover, #axwiz-root *:active { transform: none !important; }
  .axm-rv { transform: none; transition: opacity .3s ease; }
  .axm-confetti { display: none; }
}
