/* ==========================================================================
   RENOVALUZ - GLOBAL DESIGN SYSTEM & TOKENS
   Arquivo: /css/global.css
   Descrição: Variáveis globais, tipografia, resets, design tokens, temas
              Claro/Escuro, micro-animações e classes utilitárias.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. IMPORTAÇÃO DE FONTES MODERNAS
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* --------------------------------------------------------------------------
   2. DESIGN TOKENS & VARIÁVEIS DE SISTEMA (TEMA PADRÃO / CLARO)
   -------------------------------------------------------------------------- */
:root {
  /* Paleta Primária de Marca (Verde Sustentável & Bio-Tech) */
  --color-brand-primary: #0a8a13;
  --color-brand-primary-hover: #087310;
  --color-brand-primary-light: #e8f7ea;
  --color-brand-primary-subtle: rgba(10, 138, 19, 0.08);
  --color-brand-primary-glow: rgba(10, 138, 19, 0.35);

  --color-brand-dark: #004800;
  --color-brand-dark-hover: #003600;
  --color-brand-dark-light: #e6f0e6;

  --color-brand-accent: #4ade80;
  --color-brand-accent-glow: rgba(74, 222, 128, 0.45);

  --color-brand-lime: #a3e635;
  --color-brand-emerald: #10b981;
  --color-brand-teal: #0d9488;

  /* Gradientes Corporativos */
  --gradient-primary: linear-gradient(135deg, #0a8a13 0%, #004800 100%);
  --gradient-primary-reverse: linear-gradient(135deg, #004800 0%, #0a8a13 100%);
  --gradient-accent: linear-gradient(135deg, #4ade80 0%, #0a8a13 100%);
  --gradient-hero-bg: linear-gradient(180deg, #fbfdfa 0%, #f4f8f4 100%);
  --gradient-surface: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 252, 248, 0.8));
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.3) 100%);

  /* Superfícies & Cores Neutras (Modo Claro) */
  --color-bg-base: #f8faf8;
  --color-bg-surface: #ffffff;
  --color-bg-surface-elevated: #ffffff;
  --color-bg-subtle: #f1f5f1;
  --color-bg-muted: #e6ede6;

  /* Cores de Texto e Hierarquia */
  --color-text-title: #0f2412;
  --color-text-primary: #233827;
  --color-text-secondary: #526b56;
  --color-text-muted: #7e9982;
  --color-text-inverse: #ffffff;

  /* Cores de Feedback & Alertas */
  --color-success: #16a34a;
  --color-success-bg: #dcfce7;
  --color-warning: #f59e0b;
  --color-warning-bg: #fef3c7;
  --color-danger: #dc2626;
  --color-danger-bg: #fee2e2;
  --color-info: #0284c7;
  --color-info-bg: #e0f2fe;

  /* Bordas e Divisores */
  --color-border-subtle: rgba(10, 138, 19, 0.1);
  --color-border-medium: rgba(10, 138, 19, 0.2);
  --color-border-strong: rgba(10, 138, 19, 0.4);
  --color-border-glass: rgba(255, 255, 255, 0.6);

  /* Sombras e Elevação (Refined Soft Elevation) */
  --shadow-xs: 0 1px 2px rgba(15, 36, 18, 0.04);
  --shadow-sm: 0 4px 12px rgba(15, 36, 18, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 36, 18, 0.07);
  --shadow-lg: 0 16px 40px rgba(15, 36, 18, 0.09);
  --shadow-xl: 0 24px 64px rgba(15, 36, 18, 0.12);
  --shadow-glow: 0 0 30px rgba(74, 222, 128, 0.35);
  --shadow-card-hover: 0 20px 45px rgba(10, 138, 19, 0.14);

  /* Tipografia */
  --font-family-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-family-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Escala Modular Tipográfica */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-md: 1.125rem;    /* 18px */
  --text-lg: 1.25rem;     /* 20px */
  --text-xl: 1.5rem;      /* 24px */
  --text-2xl: 1.875rem;   /* 30px */
  --text-3xl: 2.25rem;    /* 36px */
  --text-4xl: 3rem;       /* 48px */
  --text-5xl: 3.75rem;    /* 60px */
  --text-6xl: 4.5rem;     /* 72px */

  /* Pesos de Fonte */
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Altura de Linha */
  --line-height-tight: 1.15;
  --line-height-snug: 1.3;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.75;

  /* Espaçamentos e Grid */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */

  /* Raio de Arredondamento */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-2xl: 36px;
  --radius-full: 9999px;

  /* Transições e Animações */
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Dimensões Fixas */
  --header-height: 80px;
  --container-max-width: 1280px;

  /* Efeito de Vidro */
  --backdrop-blur-sm: blur(8px);
  --backdrop-blur-md: blur(16px);
  --backdrop-blur-lg: blur(24px);
}

/* --------------------------------------------------------------------------
   3. TEMA ESCURO (DARK THEME TOKENS)
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  --color-bg-base: #071209;
  --color-bg-surface: #0e2012;
  --color-bg-surface-elevated: #152d1b;
  --color-bg-subtle: #112616;
  --color-bg-muted: #1c3822;

  --color-text-title: #f1fcf3;
  --color-text-primary: #dbeede;
  --color-text-secondary: #98b89e;
  --color-text-muted: #6b8a71;
  --color-text-inverse: #071209;

  --gradient-hero-bg: linear-gradient(180deg, #071209 0%, #050d07 100%);
  --gradient-surface: linear-gradient(145deg, rgba(14, 32, 18, 0.95), rgba(10, 24, 13, 0.8));
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.01) 100%);

  --color-border-subtle: rgba(74, 222, 128, 0.12);
  --color-border-medium: rgba(74, 222, 128, 0.22);
  --color-border-strong: rgba(74, 222, 128, 0.45);
  --color-border-glass: rgba(255, 255, 255, 0.08);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.7);
  --shadow-xl: 0 24px 72px rgba(0, 0, 0, 0.85);
  --shadow-glow: 0 0 35px rgba(74, 222, 128, 0.25);
  --shadow-card-hover: 0 20px 50px rgba(0, 0, 0, 0.65);
}

/* --------------------------------------------------------------------------
   4. RESET MODERNO & REGRAS FUNDAMENTAIS
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family-body);
  font-size: var(--text-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-base);
  background-image: var(--gradient-hero-bg);
  /* REMOVIDO: background-attachment: fixed — era isto que causava as "barras laterais" ao rolar */
  background-repeat: no-repeat;
  background-size: cover;
  overflow-x: hidden;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

body.menu-open,
body.modal-open {
  overflow: hidden !important;
  touch-action: none;
}

/* --------------------------------------------------------------------------
   5. TIPOGRAFIA & HIERARQUIA
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-display);
  color: var(--color-text-title);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  font-weight: var(--font-weight-extrabold);
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.85rem, 3.5vw, 3rem);
  letter-spacing: -0.025em;
}

h3 {
  font-size: clamp(1.35rem, 2.5vw, 2rem);
}

h4 {
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
}

p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
  line-height: var(--line-height-relaxed);
}

p:last-child {
  margin-bottom: 0;
}

strong, b {
  font-weight: var(--font-weight-bold);
  color: var(--color-text-title);
}

small {
  font-size: var(--text-sm);
}

a {
  color: var(--color-brand-primary);
  text-decoration: none;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

a:hover {
  color: var(--color-brand-primary-hover);
}

img, svg, picture, video {
  display: block;
  max-width: 100%;
  height: auto;
  user-select: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* --------------------------------------------------------------------------
   6. LAYOUT & CONTAINERS
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

@media (max-width: 768px) {
  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

.section {
  position: relative;
  padding-top: var(--space-20);
  padding-bottom: var(--space-20);
}

@media (max-width: 768px) {
  .section {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
  }
}

.section-header {
  text-align: center;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-12);
}

.section-header--left {
  text-align: left;
  margin-left: 0;
}

.section-title {
  margin-top: var(--space-3);
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  line-height: var(--line-height-normal);
}

/* --------------------------------------------------------------------------
   7. CLASSES UTILITÁRIAS & TEXTOS ESPECIAIS
   -------------------------------------------------------------------------- */
.highlight {
  color: var(--color-brand-primary);
  position: relative;
}

.highlight-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-white {
  color: #ffffff !important;
}

.text-muted {
  color: var(--color-text-muted) !important;
}

/* --------------------------------------------------------------------------
   8. COMPONENTES VISUAIS BASE (PILLS, GLASS, BADGES)
   -------------------------------------------------------------------------- */
.pill-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-brand-primary-subtle);
  border: 1px solid var(--color-border-medium);
  border-radius: var(--radius-full);
  color: var(--color-brand-primary);
  font-family: var(--font-family-body);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: var(--backdrop-blur-sm);
  -webkit-backdrop-filter: var(--backdrop-blur-sm);
  transition: all var(--transition-fast);
}

.pill-tag i {
  font-size: 1rem;
}

.pill-tag:hover {
  background: var(--color-brand-primary-light);
  transform: translateY(-1px);
}

.pill-tag--white {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.pill-tag--white:hover {
  background: rgba(255, 255, 255, 0.25);
}

.glass-card {
  background: var(--gradient-glass);
  backdrop-filter: var(--backdrop-blur-md);
  -webkit-backdrop-filter: var(--backdrop-blur-md);
  border: 1px solid var(--color-border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.glass-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-medium);
}

/* --------------------------------------------------------------------------
   9. ANIMAÇÕES & MICRO-INTERAÇÕES
   -------------------------------------------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translate3d(0, -30px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translate3d(-30px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translate3d(30px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.2);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 35px rgba(74, 222, 128, 0.45);
  }
}

@keyframes floatSlow {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-12px) rotate(1deg);
  }
}

@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Classes controladas por Intersection Observer (animations.js) */
[data-reveal] {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

[data-reveal="fade-up"] {
  transform: translate3d(0, 40px, 0);
}

[data-reveal="fade-down"] {
  transform: translate3d(0, -40px, 0);
}

[data-reveal="fade-left"] {
  transform: translate3d(40px, 0, 0);
}

[data-reveal="fade-right"] {
  transform: translate3d(-40px, 0, 0);
}

[data-reveal="zoom-in"] {
  transform: scale3d(0.92, 0.92, 1);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
}

/* --------------------------------------------------------------------------
   10. SCROLLBAR CUSTOMIZADA & ACESSIBILIDADE
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--color-brand-primary);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-bg-base);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-brand-primary-hover);
}

:focus-visible {
  outline: 3px solid var(--color-brand-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

@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;
  }
}