/**
 * Motion FX & Visual Design Engine
 * Ultra-modern fintech animations, 3D tilt, aurora glows, and micro-interactions
 */

:root {
  --fx-cyan: #00f2fe;
  --fx-indigo: #7c3aed;
  --fx-emerald: #10b981;
  --fx-spring-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fx-bounce-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========================================================
   1. LUMINOUS AURORA & MESH BACKGROUNDS
   ======================================================== */
.aurora-canvas {
  position: relative;
  overflow: hidden;
  background-color: #050814;
}

.aurora-glow-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  mix-blend-mode: screen;
  will-change: transform;
}

.aurora-orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.8) 0%, rgba(79, 172, 254, 0) 70%);
  top: -150px;
  left: 10%;
  animation: floatOrb1 18s ease-in-out infinite alternate;
}

.aurora-orb-2 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.75) 0%, rgba(139, 92, 246, 0) 70%);
  top: 15%;
  right: 5%;
  animation: floatOrb2 22s ease-in-out infinite alternate;
}

.aurora-orb-3 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.5) 0%, rgba(5, 150, 105, 0) 70%);
  bottom: -100px;
  left: 30%;
  animation: floatOrb3 16s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.12); }
  100% { transform: translate(-40px, 80px) scale(0.92); }
}

@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-70px, -50px) scale(1.18); }
  100% { transform: translate(50px, 60px) scale(0.95); }
}

@keyframes floatOrb3 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(80px, -60px) scale(1.1); }
  100% { transform: translate(-60px, -30px) scale(0.9); }
}

/* ========================================================
   2. FLOATING CURRENCY ORBITALS
   ======================================================== */
.orbital-token {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  z-index: 10;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  user-select: none;
}

.orbital-token:hover {
  transform: translateY(-4px) scale(1.06);
  border-color: rgba(0, 242, 254, 0.6);
  box-shadow: 0 20px 45px -5px rgba(0, 242, 254, 0.35);
}

.orbital-float-1 { animation: orbitalBob 7s ease-in-out infinite; }
.orbital-float-2 { animation: orbitalBob 8.5s ease-in-out 1s infinite; }
.orbital-float-3 { animation: orbitalBob 6.5s ease-in-out 2s infinite; }
.orbital-float-4 { animation: orbitalBob 9s ease-in-out 1.5s infinite; }
.orbital-float-5 { animation: orbitalBob 7.8s ease-in-out 0.5s infinite; }

@keyframes orbitalBob {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(1.5deg); }
}

/* ========================================================
   3. 3D INTERACTIVE TILT & HOLOGRAPHIC SHEEN
   ======================================================== */
.tilt-card-wrapper {
  perspective: 1200px;
  transform-style: preserve-3d;
  display: inline-block;
  width: 100%;
}

.tilt-card-body {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out, box-shadow 0.25s ease;
  will-change: transform;
}

.tilt-card-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle 320px at var(--glare-x, 50%) var(--glare-y, 50%), rgba(255, 255, 255, 0.28), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  mix-blend-mode: overlay;
  z-index: 20;
}

.tilt-card-body:hover .tilt-card-glare {
  opacity: 1;
}

/* Holographic dynamic rainbow layer */
.tilt-card-holo {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    125deg,
    rgba(255, 0, 128, 0.12) 0%,
    rgba(0, 242, 254, 0.16) 25%,
    rgba(124, 58, 237, 0.14) 50%,
    rgba(255, 215, 0, 0.12) 75%,
    rgba(0, 242, 254, 0.15) 100%
  );
  background-size: 200% 200%;
  background-position: var(--holo-pos, 0% 0%);
  mix-blend-mode: color-dodge;
  opacity: 0.7;
  z-index: 15;
}

/* ========================================================
   4. MORPHING PAYMENT BUTTON (IDLE -> SPINNER -> CHECKMARK)
   ======================================================== */
.btn-morph {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  color: #ffffff;
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  box-shadow: 0 10px 25px -5px rgba(14, 165, 233, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.4s var(--fx-spring-ease);
}

.btn-morph:hover:not(.loading):not(.success) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 15px 35px -5px rgba(14, 165, 233, 0.65), 0 0 20px rgba(99, 102, 241, 0.4);
}

.btn-morph:active:not(.loading):not(.success) {
  transform: translateY(1px) scale(0.98);
}

/* State: Loading */
.btn-morph.loading {
  width: 52px !important;
  min-width: 52px !important;
  height: 52px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  cursor: wait;
}

.btn-morph.loading .btn-morph-text,
.btn-morph.loading .btn-morph-icon {
  display: none;
}

.btn-morph.loading .btn-morph-spinner {
  display: block;
}

/* State: Success */
.btn-morph.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  box-shadow: 0 12px 30px -4px rgba(16, 185, 129, 0.6), 0 0 25px rgba(16, 185, 129, 0.4) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}

.btn-morph.success .btn-morph-text,
.btn-morph.success .btn-morph-spinner {
  display: none;
}

.btn-morph.success .btn-morph-check {
  display: flex;
}

.btn-morph-spinner {
  display: none;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: morphSpin 0.75s linear infinite;
}

.btn-morph-check {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  animation: morphPop 0.4s var(--fx-bounce-ease);
}

@keyframes morphSpin {
  to { transform: rotate(360deg); }
}

@keyframes morphPop {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* ========================================================
   5. SLIDING TAB GLIDER BAR
   ======================================================== */
.tab-glider-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 4px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tab-glider-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.9) 0%, rgba(99, 102, 241, 0.9) 100%);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
  transition: all 0.35s var(--fx-spring-ease);
  pointer-events: none;
  z-index: 1;
}

.tab-glider-item {
  position: relative;
  z-index: 2;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.25s ease;
  user-select: none;
  white-space: nowrap;
}

.tab-glider-item.active {
  color: #ffffff;
}

/* ========================================================
   6. COPY-TO-CLIPBOARD PILL POP
   ======================================================== */
.copy-pop-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: all 0.2s var(--fx-spring-ease);
}

.copy-pop-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.copy-pop-btn.copied {
  background: rgba(16, 185, 129, 0.25) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.5) !important;
  animation: copyBounce 0.4s var(--fx-bounce-ease);
}

@keyframes copyBounce {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ========================================================
   7. LIVE RADAR HEALTH PING
   ======================================================== */
.radar-beacon {
  position: relative;
  display: inline-flex;
  width: 10px;
  height: 10px;
}

.radar-beacon-ping {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: var(--fx-emerald);
  opacity: 0.75;
  animation: radarWave 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.radar-beacon-dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--fx-emerald);
}

@keyframes radarWave {
  75%, 100% {
    transform: scale(3);
    opacity: 0;
  }
}

/* ========================================================
   8. SKELETON SHIMMER (DIAGONAL SWEEP)
   ======================================================== */
.skeleton-shimmer {
  background: linear-gradient(
    105deg,
    rgba(30, 41, 59, 0.6) 0%,
    rgba(51, 65, 85, 0.8) 50%,
    rgba(30, 41, 59, 0.6) 100%
  );
  background-size: 200% 100%;
  animation: shimmerSweep 1.8s infinite;
}

@keyframes shimmerSweep {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========================================================
   9. SPRING MODAL & DRAWER TRANSITIONS
   ======================================================== */
.modal-spring {
  animation: modalSpringIn 0.45s var(--fx-spring-ease) forwards;
}

@keyframes modalSpringIn {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Accessibility: Reduce motion if requested */
@media (prefers-reduced-motion: reduce) {
  .aurora-orb,
  .orbital-token,
  .tilt-card-body,
  .btn-morph,
  .tab-glider-pill {
    animation: none !important;
    transition: none !important;
  }
}


/* ========================================================
   10. CINEMATIC AUTH & SMART MOTION SYSTEM
   ======================================================== */
.cinematic-auth-wrapper {
  position: relative;
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  overflow: hidden;
}

.cinematic-card-glass {
  position: relative;
  background: rgba(8, 14, 28, 0.72) !important;
  backdrop-filter: blur(28px) saturate(210%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(210%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 1.5rem !important;
  box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.9), 0 0 40px -10px rgba(0, 242, 254, 0.15), inset 0 1px 1px 0 rgba(255, 255, 255, 0.2) !important;
  transition: transform 0.4s var(--fx-spring-ease), box-shadow 0.4s var(--fx-spring-ease), border-color 0.3s ease;
}

.cinematic-card-glass:hover {
  border-color: rgba(0, 242, 254, 0.35) !important;
  box-shadow: 0 35px 90px -12px rgba(0, 0, 0, 0.95), 0 0 55px -8px rgba(0, 242, 254, 0.25), inset 0 1px 1px 0 rgba(255, 255, 255, 0.25) !important;
}

.cinematic-card-glass::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 242, 254, 0.8), rgba(124, 58, 237, 0.8), transparent);
  border-radius: 1.5rem 1.5rem 0 0;
  pointer-events: none;
}

.cinematic-input-group {
  position: relative;
  transition: transform 0.25s var(--fx-spring-ease);
}

.cinematic-input-group:focus-within {
  transform: translateY(-2px);
}

.cinematic-input {
  width: 100%;
  background: rgba(5, 9, 20, 0.82) !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  border-radius: 0.85rem !important;
  padding: 0.85rem 1rem !important;
  color: #ffffff !important;
  font-size: 0.925rem !important;
  transition: all 0.25s var(--fx-spring-ease) !important;
}

.cinematic-input:focus {
  outline: none !important;
  border-color: #00f2fe !important;
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.22), 0 10px 25px -5px rgba(0, 242, 254, 0.25) !important;
  background: rgba(7, 12, 26, 0.95) !important;
}

.cinematic-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.cinematic-input-group:focus-within .cinematic-label {
  color: #00f2fe;
}

.cinematic-btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.95rem 1.5rem;
  border-radius: 0.85rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 50%, #7c3aed 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 25px -5px rgba(14, 165, 233, 0.5), 0 0 20px -2px rgba(124, 58, 237, 0.35);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s var(--fx-spring-ease);
}

.cinematic-btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
  box-shadow: 0 15px 35px -5px rgba(14, 165, 233, 0.65), 0 0 30px rgba(124, 58, 237, 0.5);
}

.cinematic-btn-primary:active {
  transform: translateY(1px) scale(0.985);
}

.cinematic-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: #00f2fe;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  backdrop-filter: blur(12px);
  animation: badgeBob 4s ease-in-out infinite;
}

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

.cinematic-error-shake {
  animation: errorShake 0.45s var(--fx-spring-ease) both;
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.cinematic-hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
