/* ==========================================================================
   CheckSmartCardBalance - Animations
   ========================================================================== */

/* ============ Preloader ============ */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#preloader.done {
  opacity: 0;
  visibility: hidden;
}

.preloader-logo {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 12px 30px rgba(24, 99, 220, 0.35);
  animation: pulseLogo 1.2s ease-in-out infinite;
}

.preloader-logo svg {
  width: 30px;
  height: 30px;
}

.preloader-bar {
  width: 140px;
  height: 4px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
  margin: 18px auto 0;
}

.preloader-bar span {
  display: block;
  height: 100%;
  width: 45%;
  background: var(--gradient);
  border-radius: 4px;
  animation: loadSlide 1.1s ease-in-out infinite;
}

@keyframes pulseLogo {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes loadSlide {
  0% { transform: translateX(-140%); }
  100% { transform: translateX(330%); }
}

/* ============ Scroll reveal ============ */
.reveal {
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal[data-reveal="up"]   { transform: translateY(32px); }
.reveal[data-reveal="left"]  { transform: translateX(-42px); }
.reveal[data-reveal="right"] { transform: translateX(42px); }
.reveal[data-reveal="zoom"]  { transform: scale(0.92); }

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ============ Hero entrance ============ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: none; }
}

body.loaded .hero-copy > * {
  animation: fadeUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.loaded .hero-copy .eyebrow       { animation-delay: 0.05s; }
body.loaded .hero-copy h1             { animation-delay: 0.15s; }
body.loaded .hero-copy .lead          { animation-delay: 0.28s; }
body.loaded .hero-copy .hero-actions  { animation-delay: 0.42s; }
body.loaded .hero-copy .hero-trust    { animation-delay: 0.56s; }

body.loaded .hero-art {
  animation: fadeUp 0.9s 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes heroZoomIn {
  from { opacity: 0; transform: scale(0.9) rotate(4deg); }
  to   { opacity: 1; transform: scale(1) rotate(4deg); }
}

/* ============ Animated gradient orbs ============ */
.hero-grid {
  z-index: 1;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 14s ease-in-out infinite;
}

.orb-1 {
  width: 380px;
  height: 380px;
  background: rgba(24, 99, 220, 0.35);
  top: -130px;
  left: -90px;
}

.orb-2 {
  width: 320px;
  height: 320px;
  background: rgba(124, 58, 237, 0.32);
  bottom: -120px;
  right: -70px;
  animation-delay: -6s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(45px, -35px) scale(1.18); }
}

/* ============ Scroll hint ============ */
.scroll-hint {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  margin-top: 56px;
  color: var(--muted);
}

.scroll-hint svg {
  width: 26px;
  height: 26px;
  animation: bounceDown 1.8s ease-in-out infinite;
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%      { transform: translateY(10px); opacity: 1; }
}

/* ============ Gradient text flow ============ */
.gradient-text,
.stat-card .stat,
.result-panel .r-balance {
  background-size: 220% auto;
  animation: gradientFlow 6s ease infinite alternate;
}

@keyframes gradientFlow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* ============ Gift card illustration ============ */
.card-illu {
  animation:
    cardSway 6s ease-in-out infinite,
    cardGlow 5s ease-in-out infinite;
}

@keyframes cardSway {
  0%, 100% { transform: rotate(4deg) translateY(0); }
  50%      { transform: rotate(2.4deg) translateY(-9px); }
}

@keyframes cardGlow {
  0%, 100% { box-shadow: var(--shadow-lg); }
  50%      { box-shadow: 0 32px 84px -18px rgba(124, 58, 237, 0.55); }
}

/* ============ Floating badges ============ */
.badge-float::after {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: inherit;
  border: 2px solid currentColor;
  opacity: 0.6;
  animation: ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
  pointer-events: none;
}

.badge-float.two::after {
  animation-delay: 1.2s;
}

@keyframes ping {
  0%        { transform: scale(1); opacity: 0.6; }
  80%, 100% { transform: scale(1.4); opacity: 0; }
}

/* ============ Button shine ============ */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 55%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  animation: shine 3.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shine {
  0%, 55% { left: -130%; }
  100%    { left: 140%; }
}

/* ============ Header on scroll ============ */
.site-header {
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

/* ============ Nav underline ============ */
.main-nav a {
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
  transform: translateX(-50%);
  transition: width 0.25s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: calc(100% - 30px);
}

/* ============ Feature cards ============ */
.feature-card .feature-icon {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.12) rotate(-8deg);
}

/* ============ Steps ============ */
.step-num {
  animation: stepGlow 3s ease-in-out infinite;
}

.step-card:hover .step-num {
  animation: stepPulse 0.6s ease;
}

@keyframes stepGlow {
  0%, 100% { box-shadow: 0 6px 16px rgba(24, 99, 220, 0.28); }
  50%      { box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4); }
}

@keyframes stepPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}

/* ============ Brand marquee ============ */
.brand-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.brand-marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}

.brand-marquee:hover .brand-marquee-track {
  animation-play-state: paused;
}

.brand-marquee-group {
  display: flex;
  gap: 16px;
  padding-right: 16px;
}

.brand-pill {
  flex: none;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============ Stats ============ */
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* ============ Testimonials ============ */
.testi .avatar {
  transition: transform 0.3s ease;
}

.testi:hover .avatar {
  transform: rotate(-8deg) scale(1.08);
}

.testi .stars {
  display: inline-block;
  animation: starPop 0.5s ease;
}

@keyframes starPop {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ============ CTA panel ============ */
.cta-panel {
  animation: ctaPulse 5s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: var(--shadow-lg); }
  50%      { box-shadow: 0 34px 90px -20px rgba(24, 99, 220, 0.5); }
}

.cta-panel .btn-white {
  animation: ctaBtnBob 3s ease-in-out infinite;
}

@keyframes ctaBtnBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* ============ Form result ============ */
.result-panel.ok.show {
  animation: popIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.result-panel.err.show {
  animation: shake 0.4s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

/* ============ Mission / about ============ */
.mission-card .icon {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mission-card:hover .icon {
  transform: rotate(-8deg) scale(1.1);
}

/* ============ Footer ============ */
.site-footer .site-logo {
  transition: transform 0.3s ease;
}

.site-footer .site-logo:hover {
  transform: scale(1.03);
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
