/* ============================================================
   PIVA Educacional — MFES Landing Page v4
   Custom CSS (only what Tailwind CDN cannot do)
   Herdado de v3 + ajustes de espaçamento comprimido + helpers
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --primary: #008994;
  --primary-dark: #006B73;
  --secondary: #F5EDE3;
  --accent: #E8860C;
  --accent-dark: #C47200;
  --text: #1C1C1C;
  --text-light: #5A5A5A;
  --bg: #FFFDF8;
  --bg-alt: #F0EBE3;
  --bg-dark: #0A3D42;
  --border: #E0D8CE;
  --text-on-dark: #F5EDE3;
}

/* --- Base --- */
html {
  scroll-behavior: smooth;
  font-size: 17px;
}

@media (min-width: 768px) {
  html {
    font-size: 18px;
  }
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: var(--bg);
  color: var(--text);
  position: relative;
}

/* Subtle grain/noise texture */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* Dark sections above noise */
.section-dark {
  position: relative;
  z-index: 1;
}

/* --- Hero radial glow --- */
.hero-glow {
  position: absolute;
  top: -20%;
  left: -10%;
  width: 60%;
  height: 140%;
  background: radial-gradient(ellipse at center, rgba(0, 137, 148, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* --- Sequestro de Prova highlight --- */
.sequestro-highlight {
  font-family: 'Lora', serif;
  font-style: italic;
  font-weight: 600;
  background-color: rgba(0, 137, 148, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

/* --- FAQ Accordion --- */
.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  -webkit-user-select: none;
  user-select: none;
}

.faq-question .faq-chevron {
  transition: transform 300ms ease;
  flex-shrink: 0;
  margin-left: 16px;
}

.faq-item.active .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease, padding 300ms ease;
  padding-bottom: 0;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding-bottom: 20px;
}

/* --- Floating CTA --- */
.floating-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 12px 20px;
  background: rgba(255, 253, 248, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(100%);
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-cta.visible {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .floating-cta {
    display: none !important;
  }
}

/* --- Custom bullet --- */
ul.custom-bullet {
  list-style: none;
  padding-left: 0;
}

ul.custom-bullet li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 12px;
}

ul.custom-bullet li::before {
  content: '\2726';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-size: 1.1em;
}

/* Inline variant — for trust bullets in hero and flex rows */
span.custom-bullet {
  position: relative;
  padding-left: 18px;
  display: inline-block;
}

span.custom-bullet::before {
  content: '\2726';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 0.95em;
  line-height: 1;
}

/* --- Callout Erro #1 --- */
.callout-erro {
  border-left: 4px solid var(--accent);
  background-color: rgba(232, 134, 12, 0.08);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 24px 0;
}

/* --- Card hover effects --- */
.card-hover {
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* --- CTA Button --- */
.cta-button {
  display: inline-block;
  max-width: 400px;
  width: 100%;
  text-align: center;
  background-color: var(--accent);
  color: var(--bg);
  font-weight: 600;
  padding: 16px 32px;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: background-color 200ms ease, transform 200ms ease;
  cursor: pointer;
  border: none;
  font-size: 1rem;
  line-height: 1;
}

@media (min-width: 768px) {
  .cta-button {
    font-size: 1.125rem;
  }
}

.cta-button:hover {
  background-color: var(--accent-dark);
  transform: scale(1.02);
}

.cta-button:active {
  transform: scale(0.98);
}

/* --- Video Thumbnail --- */
.video-thumbnail {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 12px;
}

.video-thumbnail::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  transition: background 200ms ease;
}

.video-thumbnail:hover::after {
  background: rgba(0, 0, 0, 0.15);
}

.video-thumbnail .play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 68px;
  height: 68px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: transform 200ms ease;
}

.video-thumbnail:hover .play-button {
  transform: translate(-50%, -50%) scale(1.08);
}

.video-thumbnail .play-button svg {
  width: 24px;
  height: 24px;
  margin-left: 3px;
  fill: #FFFDF8;
}

.video-thumbnail iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* --- Scroll Indicator --- */
.scroll-indicator {
  animation: scroll-bounce 2s ease-in-out infinite;
  transition: opacity 400ms ease;
}

/* --- Logo Carousel (infinite scroll) --- */
.logo-carousel {
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

.logo-carousel-track {
  animation: logo-scroll 35s linear infinite;
  width: max-content;
}

.logo-carousel-track:hover {
  animation-play-state: paused;
}

@keyframes logo-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes scroll-bounce {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  50% {
    transform: translateY(8px);
    opacity: 1;
  }
}

/* --- Infographic (desktop circular) --- */
.infografico-desktop {
  display: none;
}

@media (min-width: 1024px) {
  .infografico-desktop {
    display: block;
  }
  .infografico-mobile {
    display: none;
  }
}

/* --- Infographic Step --- */
.infografico-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
}

.infografico-step .step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Lora', serif;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.infografico-arrow {
  width: 2px;
  height: 24px;
  margin-left: 17px;
}

/* --- Steps container (3 steps with arrows) --- */
.steps-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 768px) {
  .steps-container {
    flex-direction: row;
    gap: 0;
    align-items: flex-start;
  }
}

.step-arrow {
  display: none;
}

@media (min-width: 768px) {
  .step-arrow {
    display: flex;
    align-items: center;
    padding: 0 12px;
    padding-top: 40px;
    color: var(--primary);
    font-size: 1.5rem;
    flex-shrink: 0;
  }
}

/* --- [data-animate] base states for GSAP --- */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
}

[data-animate="fade-slow"] {
  opacity: 0;
  transform: none;
}

[data-animate="scale-in"] {
  opacity: 0;
  transform: scale(0.95);
}

/* .no-gsap fallback: show everything */
.no-gsap [data-animate],
.no-gsap [data-animate="fade-slow"],
.no-gsap [data-animate="scale-in"] {
  opacity: 1;
  transform: none;
}

/* --- Stats counter --- */
.stat-number {
  font-variant-numeric: tabular-nums;
}

/* --- Card depoimento --- */
.card-depoimento {
  border-left: 3px solid var(--primary);
  border-radius: 0 12px 12px 0;
}

/* --- Card modulo --- */
.card-modulo {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  background: var(--bg);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.card-modulo:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

/* --- Card custo --- */
.card-custo {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

.card-custo.card-custo--expensive {
  background: #f8f4ef;
}

.card-custo.card-custo--mfes {
  background: var(--bg);
  border-color: var(--accent);
  border-width: 2px;
}

/* --- Print styles --- */
@media print {
  .floating-cta,
  .scroll-indicator,
  .video-thumbnail .play-button,
  body::before {
    display: none !important;
  }

  section {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  [data-animate] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* --- 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;
  }

  .scroll-indicator {
    animation: none;
  }
  .logo-carousel-track {
    animation: none;
  }
}

/* --- Focus visible --- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 4px;
}

.cta-button:focus-visible {
  outline-color: var(--accent-dark);
  outline-offset: 4px;
}

/* --- NPS Badge --- */
.nps-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary);
  border-radius: 50%;
  font-family: 'Lora', serif;
}

.nps-badge--sm {
  width: 56px;
  height: 56px;
}

.nps-badge--md {
  width: 80px;
  height: 80px;
}

.nps-badge--lg {
  width: 100px;
  height: 100px;
}

/* --- Garantia badge --- */
.garantia-badge {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

/* --- Pra quem e checkmark --- */
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.check-item .check-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--primary);
  margin-top: 2px;
}
