@tailwind base;
@tailwind components;
@tailwind utilities;

/* ─── Base ─── */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(225, 170, 54, 0.08), transparent 24%),
    radial-gradient(circle at top right, rgba(0, 106, 106, 0.06), transparent 20%),
    var(--color-surface);
  color: var(--color-on-background);
  font-family: 'Plus Jakarta Sans', sans-serif;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

/* ─── Navbar Glass ─── */
.glass-nav {
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 1px 3px rgba(27, 28, 28, 0.04);
  transition: box-shadow 0.4s ease, background-color 0.4s ease;
}

.glass-nav.scrolled {
  box-shadow: 0 8px 32px rgba(27, 28, 28, 0.1);
  background-color: rgba(251, 249, 248, 0.92) !important;
}

/* ─── Metallic Gradient ─── */
.metallic-gradient {
  background: linear-gradient(135deg, #7b5800 0%, #c99a28 45%, #e1aa36 100%);
  background-size: 200% 200%;
  animation: shimmer 6s ease-in-out infinite;
}

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

/* ─── Material Icons ─── */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

/* ─── Hero Visual Border ─── */
.hero-visual::after {
  content: '';
  position: absolute;
  inset: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 1.5rem;
  pointer-events: none;
}

/* ─── Scroll Reveal Animations ─── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), 
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), 
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), 
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), 
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* ─── Stagger delays ─── */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }

/* ─── 3D Card Hover ─── */
.card-3d {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), 
              box-shadow 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.card-3d:hover {
  transform: translateY(-8px) rotateX(2deg) rotateY(-1deg);
  box-shadow: 0 32px 64px rgba(27, 28, 28, 0.12), 0 0 0 1px rgba(225, 170, 54, 0.1);
}

/* ─── Floating Particles ─── */
@keyframes float-up {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.3; }
  100% { transform: translateY(-20vh) scale(1); opacity: 0; }
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(225, 170, 54, 0.5);
  animation: float-up linear infinite;
  pointer-events: none;
}

/* ─── WhatsApp Floating Button ─── */
.whatsapp-float {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  animation: pulse-green 2s ease-in-out infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 36px rgba(37, 211, 102, 0.5);
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35); }
  50% { box-shadow: 0 8px 24px rgba(37, 211, 102, 0.55), 0 0 0 12px rgba(37, 211, 102, 0.1); }
}

/* ─── Counter Animation ─── */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.counter-animate {
  animation: countUp 0.6s ease-out forwards;
}

/* ─── Gradient Text ─── */
.gradient-text {
  background: linear-gradient(135deg, #7b5800, #e1aa36);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding-bottom: 0.15em;
  padding-right: 0.05em;
}

/* ─── Glow Effect for CTA ─── */
.cta-glow {
  position: relative;
  overflow: hidden;
}

.cta-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(225, 170, 54, 0.3), rgba(0, 106, 106, 0.2));
  z-index: -1;
  filter: blur(16px);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.cta-glow:hover::after {
  opacity: 1;
}

/* ─── Component Layer ─── */
@layer components {
  .cta-chip {
    @apply rounded-full px-6 py-2.5 font-headline text-sm font-bold tracking-wide text-white transition-all duration-300 hover:scale-105 active:scale-95;
  }

  .cta-shadow {
    box-shadow: 0 16px 32px rgba(123, 88, 0, 0.12);
  }

  .primary-cta {
    @apply inline-flex items-center gap-2 rounded-full px-8 py-4 font-headline font-bold text-white transition-all hover:-translate-y-0.5;
    box-shadow: 0 24px 42px rgba(123, 88, 0, 0.2);
  }

  .secondary-cta {
    @apply inline-flex items-center rounded-full border border-white/70 bg-white/90 px-8 py-4 font-headline font-bold text-secondary transition-all hover:border-primary/15 hover:bg-surface-container-low;
  }

  .field-input {
    @apply w-full rounded-xl border border-outline-variant/30 bg-surface-container-low p-3.5 text-on-background transition-all focus:ring-2 focus:ring-primary focus:border-primary;
  }

  .form-submit {
    @apply w-full rounded-xl py-4 font-headline font-bold text-white transition-all hover:shadow-[0_24px_40px_rgba(123,88,0,0.2)];
  }
}

/* ─── Mobile menu ─── */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-menu.open {
  transform: translateX(0);
}

/* ─── Smooth section separator ─── */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(208, 197, 175, 0.3) 20%, rgba(208, 197, 175, 0.5) 50%, rgba(208, 197, 175, 0.3) 80%, transparent);
}

/* ─── Insurer logos ─── */
.insurer-logo {
  @apply flex h-12 items-center justify-center rounded-xl border border-outline-variant/15 bg-white/60 px-6 py-2;
  transition: all 0.3s ease;
}

.insurer-logo:hover {
  background: white;
  box-shadow: 0 8px 24px rgba(27, 28, 28, 0.06);
}

/* ─── Responsive ─── */
@media (max-width: 767px) {
  .primary-cta,
  .secondary-cta {
    @apply w-full justify-center;
  }
}

/* ─── Smooth scrollbar ─── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f6f3f2;
}

::-webkit-scrollbar-thumb {
  background: #d0c5af;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #7b5800;
}
