/* ============================================
   TRANSMEDIC V2 — Design System Premium
   Inspirado: Biologística | Skills: high-end-visual-design, design-spells
   ============================================ */

/* --- CSS Variables (Design Tokens) --- */
:root {
  --color-deep: #020617;
  --color-primary: #0c4a8e;
  --color-primary-light: #1e6fd9;
  --color-accent: #f97316;
  --color-accent-hover: #ea580c;
  --color-surface: #f8fafc;
  --color-surface-alt: #f1f5f9;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-success: #22c55e;
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --radius-sm: 0.75rem;
  --radius-md: 1.25rem;
  --radius-lg: 2rem;
  --radius-full: 9999px;
  --ease-out-expo: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Base Reset & Smooth Scroll --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-surface);
  overflow-x: hidden;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }

/* --- Film Grain Overlay (design-spells) --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Scroll Reveal Animation --- */
.reveal {
  opacity: 0;
  transform: translateY(2.5rem);
  filter: blur(4px);
  transition: opacity 0.9s var(--ease-out-expo), transform 0.9s var(--ease-out-expo), filter 0.9s var(--ease-out-expo);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* --- Stagger Children --- */
.stagger > *:nth-child(1) { transition-delay: 0s; }
.stagger > *:nth-child(2) { transition-delay: 0.08s; }
.stagger > *:nth-child(3) { transition-delay: 0.16s; }
.stagger > *:nth-child(4) { transition-delay: 0.24s; }
.stagger > *:nth-child(5) { transition-delay: 0.32s; }

/* --- Floating Nav (Fluid Island) --- */
.nav-island {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: calc(100% - 2rem);
  max-width: 72rem;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: var(--radius-full);
  padding: 0.65rem 1.5rem;
  box-shadow: 0 4px 30px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  transition: all 0.5s var(--ease-out-expo);
}
.nav-island.scrolled {
  background: rgba(255,255,255,0.95);
  box-shadow: 0 8px 40px rgba(0,0,0,0.1);
}

/* --- Hamburger Morph (design-spells) --- */
.hamburger { width: 24px; height: 18px; position: relative; cursor: pointer; }
.hamburger span {
  position: absolute; left: 0; width: 100%; height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: all 0.4s var(--ease-out-expo);
}
.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 8px; }
.hamburger span:nth-child(3) { top: 16px; }
.hamburger.active span:nth-child(1) { top: 8px; transform: rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { top: 8px; transform: rotate(-45deg); }

/* --- Mobile Menu Overlay --- */
.mobile-menu {
  position: fixed; inset: 0; z-index: 99;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(30px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.5s var(--ease-out-expo);
}
.mobile-menu.active { opacity: 1; pointer-events: all; }
.mobile-menu a {
  font-size: 1.5rem; font-weight: 700; color: var(--color-primary);
  transform: translateY(1.5rem); opacity: 0;
  transition: all 0.5s var(--ease-out-expo);
}
.mobile-menu.active a { transform: translateY(0); opacity: 1; }
.mobile-menu.active a:nth-child(2) { transition-delay: 0.06s; }
.mobile-menu.active a:nth-child(3) { transition-delay: 0.12s; }
.mobile-menu.active a:nth-child(4) { transition-delay: 0.18s; }
.mobile-menu.active a:nth-child(5) { transition-delay: 0.24s; }

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #020617 0%, #0c4a8e 60%, #1e3a5f 100%);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 30%, rgba(30,111,217,0.2) 0%, transparent 60%),
              radial-gradient(ellipse at 20% 80%, rgba(249,115,22,0.08) 0%, transparent 50%);
  z-index: 1;
}
.hero-content { position: relative; z-index: 2; }

/* --- Eyebrow Tag (high-end-visual-design) --- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
}

/* --- Magnetic Button (design-spells) --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all 0.5s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}
.btn-primary:hover { background: var(--color-accent-hover); transform: scale(1.03); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary .btn-icon {
  display: flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  transition: transform 0.5s var(--ease-out-expo);
}
.btn-primary:hover .btn-icon { transform: translate(3px, -2px) scale(1.1); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: transparent;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(255,255,255,0.25);
  cursor: pointer;
  transition: all 0.5s var(--ease-out-expo);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.5); }

/* --- Double-Bezel Card (high-end-visual-design Doppelrand) --- */
.card-shell {
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: var(--radius-lg);
  padding: 0.375rem;
}
.card-core {
  background: #fff;
  border-radius: calc(2rem - 0.375rem);
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.8);
  transition: transform 0.6s var(--ease-out-expo), box-shadow 0.6s var(--ease-out-expo);
}
.card-shell:hover .card-core {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.08), inset 0 1px 1px rgba(255,255,255,0.8);
}

/* --- Stats Counter Section --- */
.stats-section {
  position: relative;
  z-index: 10;
  margin-top: -4rem;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.stat-card {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}
.stat-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
}

/* --- Section Spacing (Massive Whitespace) --- */
.section { padding: 6rem 0; }
.section-header { text-align: center; margin-bottom: 4rem; }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.section-subtitle {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 36rem;
  margin: 1rem auto 0;
  line-height: 1.7;
}

/* --- Services Grid (Uniforme 2x2) --- */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
/* Garante que todos os cards tenham a mesma altura */
.bento-grid .card-shell { grid-column: span 1; }
.bento-grid .card-core { display: flex; flex-direction: column; height: 100%; }
.bento-grid .card-core > div:last-child { flex: 1; }

/* --- Process Timeline --- */
.timeline { display: flex; gap: 2rem; position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  top: 2.5rem;
  left: 3rem;
  right: 3rem;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  opacity: 0.2;
}
.timeline-step {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
}
.timeline-icon {
  width: 5rem;
  height: 5rem;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  border: 4px solid var(--color-surface);
  box-shadow: 0 4px 20px rgba(12,74,142,0.2);
}

/* --- Marquee (Parceiros) --- */
.marquee { overflow: hidden; }
.marquee-track {
  display: flex;
  gap: 4rem;
  animation: marquee 30s linear infinite;
  width: max-content;
}
.marquee-track:hover { animation-play-state: paused; }
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.partner-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-text-muted);
  opacity: 0.4;
  white-space: nowrap;
  transition: opacity 0.3s;
  cursor: default;
}
.partner-logo:hover { opacity: 0.8; }

/* --- FAQ Accordion --- */
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
  margin-bottom: 0.75rem;
}
.faq-question {
  width: 100%;
  text-align: left;
  padding: 1.25rem 1.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s;
}
.faq-question:hover { background: var(--color-surface-alt); }
.faq-icon {
  transition: transform 0.4s var(--ease-out-expo);
  font-size: 1.25rem;
  color: var(--color-primary);
}
.faq-item.active .faq-icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease-out-expo), padding 0.5s var(--ease-out-expo);
  padding: 0 1.5rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}
.faq-item.active .faq-answer {
  max-height: 300px;
  padding: 0 1.5rem 1.5rem;
}

/* --- WhatsApp Float --- */
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 90;
  width: 3.5rem;
  height: 3.5rem;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 20px rgba(37,211,102,0.4);
  transition: transform 0.4s var(--ease-spring);
}
.whatsapp-float:hover { transform: scale(1.12); }

/* --- Carousel --- */
.carousel-container { position: relative; overflow: hidden; border-radius: calc(2rem - 0.375rem); }
.carousel-track { display: flex; transition: transform 0.6s var(--ease-out-expo); }
.carousel-slide { min-width: 100%; display: flex; align-items: center; justify-content: center; padding: 2rem; background: #fff; }
.carousel-slide img { max-height: 500px; object-fit: contain; border-radius: var(--radius-sm); }
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 3rem; height: 3rem;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1.25rem; color: var(--color-primary);
  transition: all 0.3s var(--ease-out-expo);
  z-index: 5;
}
.carousel-btn:hover { background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.carousel-btn.prev { left: 1rem; }
.carousel-btn.next { right: 1rem; }
.carousel-dots { display: flex; justify-content: center; gap: 0.5rem; padding: 1rem 0; }
.carousel-dot {
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: var(--color-border);
  border: none; cursor: pointer;
  transition: all 0.3s var(--ease-out-expo);
}
.carousel-dot.active { background: var(--color-primary); width: 1.5rem; border-radius: 0.25rem; }

/* --- Footer --- */
.footer {
  background: var(--color-deep);
  color: rgba(255,255,255,0.5);
  padding: 5rem 0 0;
}
.footer a { transition: color 0.3s; }
.footer a:hover { color: #fff; }

/* --- Container --- */
.container { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-grid { grid-template-columns: 1fr; }
  .bento-grid .card-shell { grid-column: span 1 !important; }
  .timeline { flex-direction: column; gap: 1.5rem; }
  .timeline::before { display: none; }
  .section { padding: 4rem 0; }
  .nav-island { top: 0.75rem; width: calc(100% - 1.5rem); padding: 0.5rem 1rem; }
  .nav-links { display: none !important; }
  .hamburger { display: block !important; }
  .hero { min-height: 90dvh; }
  body { padding-top: 0; }

  /* Hero grid → 1 coluna */
  .hero .container > div { grid-template-columns: 1fr !important; }

  /* Diferenciais grid → 1 coluna */
  #diferenciais .container > div { grid-template-columns: 1fr !important; }

  /* Formulário de contato → 1 coluna */
  .contact-grid { grid-template-columns: 1fr !important; padding: 1.5rem !important; gap: 2rem !important; }
  .form-row { grid-template-columns: 1fr !important; }

  /* Footer colunas → empilhadas */
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 2rem !important; }

  /* Carousel botões mais próximos */
  .carousel-btn.prev { left: 0.5rem; }
  .carousel-btn.next { right: 0.5rem; }
  .carousel-slide { padding: 1rem; }
}
@media (max-width: 480px) {
  .stat-number { font-size: 2.25rem; }
  .btn-primary, .btn-ghost { width: 100%; justify-content: center; }
  .footer-grid { grid-template-columns: 1fr !important; }
  .contact-grid { padding: 1.25rem !important; }
}
