/* ═══════════════════════════════════════════════════
   QUIMERA OS — Polish & Micro-interactions v3.0
   Apple / Samsung premium aesthetics
   ═══════════════════════════════════════════════════ */

/* ── Page Transition (fade in/out between pages) ── */
body {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}
body.page-transition-enter {
  opacity: 1;
}
body.page-transition-exit {
  opacity: 0;
  transition: opacity 0.2s ease-in;
}

/* ── Smooth counter animation ── */
@keyframes countUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Spin for loading states ── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── Fade in up ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Pulse ── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ── Shimmer loading ── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-hover) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 2.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* ── Gradient border effect on cards ── */
.card-premium {
  position: relative;
  background: var(--bg-elevated);
  border: none;
}
.card-premium::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--gold), transparent 50%, var(--border-subtle));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* ── Focus visible for accessibility (subtle gold ring) ── */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* ── Scroll hint arrow ── */
.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 1;
}
.hero-scroll span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: scrollPulse 2.4s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.2; transform: scaleY(0.5); transform-origin: top; }
  50% { opacity: 0.8; transform: scaleY(1); }
}

/* ── Gold glow text animation ── */
.gold-glow {
  text-shadow: 0 0 30px rgba(212,168,83,0.2);
}

/* ── Hover lift for interactive elements (Apple: minimal movement) ── */
.hover-lift {
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

/* ═══════════════════════════════════════════════════
   VISUAL UPGRADES — Apple / Samsung Premium v3.0
   Subtle, smooth, confident motion
   ═══════════════════════════════════════════════════ */

/* ── 1. Grid dot pattern background ── */
.bg-grid {
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}
.bg-grid-gold {
  background-image:
    radial-gradient(circle, rgba(212,168,83,0.05) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* ── 2. Aurora animated blobs (more subtle, larger, slower) ── */
@keyframes auroraFloat {
  0%   { transform: translate(0,0) scale(1) rotate(0deg); opacity: 0.04; }
  33%  { transform: translate(3%,-4%) scale(1.04) rotate(3deg); opacity: 0.05; }
  66%  { transform: translate(-2%,3%) scale(0.97) rotate(-2deg); opacity: 0.035; }
  100% { transform: translate(0,0) scale(1) rotate(0deg); opacity: 0.04; }
}
@keyframes auroraFloat2 {
  0%   { transform: translate(0,0) scale(1); opacity: 0.03; }
  50%  { transform: translate(-3%,5%) scale(1.06); opacity: 0.05; }
  100% { transform: translate(0,0) scale(1); opacity: 0.03; }
}
.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(200px);
  pointer-events: none;
  z-index: 0;
  animation: auroraFloat 35s ease-in-out infinite;
  will-change: transform, opacity;
}
.aurora-blob-2 {
  animation: auroraFloat2 40s ease-in-out infinite;
}
.aurora-gold {
  background: radial-gradient(ellipse, rgba(212,168,83,0.12) 0%, transparent 70%);
}
.aurora-purple {
  background: radial-gradient(ellipse, rgba(139,92,246,0.10) 0%, transparent 70%);
}
.aurora-blue {
  background: radial-gradient(ellipse, rgba(59,130,246,0.08) 0%, transparent 70%);
}

/* ── 3. Button sweep shimmer on hover (subtler) ── */
@keyframes btnSweep {
  0%   { transform: translateX(-100%) skewX(-20deg); }
  100% { transform: translateX(250%) skewX(-20deg); }
}
.btn-primary {
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.btn-primary:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(212,168,83,0.25);
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transform: translateX(-100%) skewX(-20deg);
  pointer-events: none;
  will-change: transform;
}
.btn-primary:hover::after {
  animation: btnSweep 0.7s ease forwards;
}

/* ── 4. Marquee / ticker for logo band (slower, smoother) ── */
@keyframes marqueeScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee-track {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}
.marquee-inner {
  display: flex;
  gap: var(--sp-6);
  width: max-content;
  animation: marqueeScroll 50s linear infinite;
  will-change: transform;
}
.marquee-inner:hover { animation-play-state: paused; }
.marquee-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0.5;
  transition: opacity 0.4s cubic-bezier(0.25, 0.1, 0.25, 1), color 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  letter-spacing: 0.05em;
}
.marquee-item:hover { opacity: 1; color: var(--gold); }
.marquee-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border-default);
  flex-shrink: 0;
}

/* ── 5. Animated gradient text (slower, smoother transitions) ── */
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.text-gradient-animated {
  background: linear-gradient(270deg, var(--gold-light), #E8A850, #D4A853, #F0C870, var(--gold-light));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 9s ease infinite;
  will-change: background-position;
}

/* ── 6. Section separator with gradient fade ── */
.section-fade-top {
  position: relative;
}
.section-fade-top::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-default), transparent);
}

/* ── 7. Glassmorphism card variant (Apple-style subtle hover) ── */
.card-glass {
  background: rgba(20, 24, 32, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  transition: background 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
              border-color 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
              box-shadow 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  contain: layout paint;
}
.card-glass:hover {
  background: rgba(20, 24, 32, 0.75);
  border-color: rgba(212,168,83,0.12);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 30px rgba(212,168,83,0.3), inset 0 1px 0 rgba(255,255,255,0.04);
  transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateY(-8px) scale(1.02);
}

/* ── 3D Elevation hover for service page cards ── */
.svc-solution-card,
.svc-pricing-card,
.svc-feature,
.svc-cta-inner {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.svc-solution-card:hover {
  transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3), 0 0 30px rgba(212,168,83,0.3);
  border-color: rgba(212,168,83,0.25);
}

.svc-pricing-card:hover {
  transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3), 0 0 30px rgba(212,168,83,0.3);
  border-color: rgba(212,168,83,0.25);
}

.svc-feature:hover {
  transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateY(-8px) scale(1.02);
}

.svc-cta-inner:hover {
  transform: perspective(1000px) rotateX(1deg) rotateY(-1deg) translateY(-4px) scale(1.01);
  box-shadow: 0 16px 36px rgba(0,0,0,0.25), 0 0 24px rgba(212,168,83,0.2);
  border-color: rgba(212,168,83,0.18);
}

/* ── 8. Highlighted stat number with glow ── */
.stat-glow {
  text-shadow: 0 0 24px rgba(212,168,83,0.25);
}

/* ── 9. Gradient divider line ── */
.divider-gradient {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--border-default) 20%, var(--gold-dim) 50%, var(--border-default) 80%, transparent 100%);
  margin: var(--sp-5) 0;
}

/* ── 10. Badge pulse (live/new indicator) ── */
@keyframes badgePulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.35); }
  50%      { box-shadow: 0 0 0 5px rgba(16,185,129,0); }
}
.badge-live::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px;
  animation: badgePulse 2.4s ease-in-out infinite;
}

/* ── 11. Noise overlay (premium texture) ── */
.noise-overlay {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}

/* ── 12. Glow ring on featured pricing card (subtler) ── */
.card-featured-glow {
  position: relative;
}
.card-featured-glow::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(162,85,255,0.4), rgba(99,30,204,0.2), transparent 60%);
  z-index: -1;
  filter: blur(16px);
  opacity: 0.4;
  transition: opacity 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.card-featured-glow:hover::after { opacity: 0.7; }

/* ═══════════════════════════════════════════════════
   OVERRIDES — Apple/Samsung refinements
   These override base styles from other CSS files
   ═══════════════════════════════════════════════════ */

/* ── Scroll-triggered fade-up animations ── */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}
.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }

/* ── Scroll reveals (override design-system.css — Apple-style small movement) ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: opacity, transform;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── Scroll progress bar (thin, Apple-style gold gradient) ── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), #F0C870, var(--gold));
  z-index: 10001;
  width: 0%;
  transition: width 60ms linear;
  will-change: width;
}

/* ── Toast notifications (slide from top-right, backdrop-blur) ── */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  bottom: auto;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: white;
  background: rgba(20, 24, 32, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  z-index: 10000;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}
.toast.visible { transform: translateX(0); }
.toast-success { border-left: 3px solid var(--green); }
.toast-error { border-left: 3px solid var(--red); }

/* ── WhatsApp float button (clean, subtle pulse) ── */
@keyframes whatsappPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(37,211,102,0.35); }
  50% { transform: scale(1.1); box-shadow: 0 6px 28px rgba(37,211,102,0.5); }
}
.whatsapp-float {
  animation: whatsappPulse 3s ease-in-out infinite;
}
.whatsapp-float:hover {
  animation: none;
}
.whatsapp-float.wpp-hidden {
  animation: none;
}

/* ── Loading spinner (clean thin ring, Apple style) ── */
.spinner {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(212,168,83,0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

/* ── Lazy-loaded image reveal ── */
img.lazy-img {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: opacity, transform;
}
img.lazy-img.img-revealed {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

/* ═══════════════════════════════════════════════════
   MICRO-INTERACTIONS — Premium Feel v4.0
   Ripple, floating labels, custom checks, hover lines
   ═══════════════════════════════════════════════════ */

/* ── A) Ripple Effect on Buttons ── */
.btn-ripple {
  position: relative;
  overflow: hidden;
}
.btn-ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 70%);
  transform: scale(0);
  transition: transform 0.5s ease;
  border-radius: inherit;
}
.btn-ripple:active::after {
  transform: scale(4);
  transition: transform 0s;
}

/* ── B) Floating Label on Inputs ── */
.input-float-group {
  position: relative;
}
.input-float-group label {
  position: absolute;
  left: 16px;
  top: 14px;
  transition: all 0.3s ease;
  pointer-events: none;
  color: rgba(255,255,255,0.5);
}
.input-float-group input:focus + label,
.input-float-group input:not(:placeholder-shown) + label {
  transform: translateY(-24px) scale(0.85);
  color: #D4A853;
}

/* ── C) Custom Checkboxes with Animation ── */
.custom-check {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s;
}
.custom-check:checked {
  background: #D4A853;
  border-color: #D4A853;
}
.custom-check:checked::after {
  content: '\2713';
  position: absolute;
  color: black;
  font-size: 14px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: checkPop 0.3s ease;
}
@keyframes checkPop {
  0%   { transform: translate(-50%, -50%) scale(0); }
  50%  { transform: translate(-50%, -50%) scale(1.3); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

/* ── D) Hover Underline Effect for Links ── */
.link-hover-effect {
  position: relative;
  text-decoration: none;
}
.link-hover-effect::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #D4A853;
  transition: width 0.3s ease;
}
.link-hover-effect:hover::after {
  width: 100%;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .aurora-blob,
  .aurora-blob-2 {
    animation: none;
  }
  .marquee-inner {
    animation: none;
  }
  .text-gradient-animated {
    animation: none;
  }
  .scroll-line {
    animation: none;
  }
  .skeleton {
    animation: none;
  }
  .badge-live::before {
    animation: none;
  }
  .btn-primary:hover::after {
    animation: none;
  }
  .hover-lift:hover {
    transform: none;
  }
  .card-glass,
  .card-premium,
  .card-featured-glow::after {
    transition: none;
  }
  .card-glass:hover,
  .svc-solution-card:hover,
  .svc-pricing-card:hover,
  .svc-feature:hover,
  .svc-cta-inner:hover {
    transform: none;
  }
  .svc-solution-card,
  .svc-pricing-card,
  .svc-feature,
  .svc-cta-inner {
    transition: none;
  }
  .whatsapp-float {
    animation: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  img.lazy-img {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
  body {
    opacity: 1;
    transition: none;
  }
  .btn-ripple::after {
    transition: none;
  }
  .input-float-group label {
    transition: none;
  }
  .custom-check {
    transition: none;
  }
  .custom-check:checked::after {
    animation: none;
  }
  .link-hover-effect::after {
    transition: none;
  }
}

/* ── Print styles ── */
@media print {
  .navbar, .whatsapp-float, .wpp-form-popup, .back-to-top,
  .scroll-progress, .lead-overlay { display: none !important; }
  body { background: white; color: black; }
  .section { padding: 24px 0; }
}
