/*
 * WWin Design System — Patterns
 * Layouts reutilizáveis: container, grid, seções, hero, footer.
 * Todos os valores referenciam tokens.css.
 */

/* =========================================================
 * CONTAINER
 * ========================================================= */

.container {
  width: min(100% - calc(var(--container-padding) * 2), var(--container-max));
  margin-inline: auto;
}

.container--narrow { max-width: 768px;  margin-inline: auto; }
.container--wide   { max-width: 1440px; margin-inline: auto; }
.container--full   { max-width: none; }

/* =========================================================
 * SEÇÃO BASE
 * ========================================================= */

.section {
  position: relative;
  padding: clamp(72px, 8vw, 120px) 0;
  overflow: hidden;
  /* Isola layout/estilo de cada seção — já tem overflow:hidden e position:relative,
     então contain não altera comportamento visual, só limita o escopo de recálculo
     de layout/estilo do navegador a cada seção individualmente */
  contain: layout style;
}

/* Separador de seção */
.section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
}

/* =========================================================
 * VARIANTES DE SEÇÃO — claras
 * Sobrescrevem as variáveis semânticas no escopo da seção.
 * ========================================================= */

.section-white {
  background: var(--bg-white);
  color: var(--text-primary);
  --color-text-primary:   var(--text-primary);
  --color-text-secondary: var(--text-secondary);
  --color-text-muted:     var(--text-muted);
  --color-bg-elevated:    var(--bg-light);
  --color-border-subtle:  rgba(2, 8, 23, 0.07);
  --color-border:         rgba(2, 8, 23, 0.12);
}

.section-light {
  background: var(--bg-light);
  color: var(--text-primary);
  --color-text-primary:   var(--text-primary);
  --color-text-secondary: var(--text-secondary);
  --color-text-muted:     var(--text-muted);
  --color-bg-elevated:    var(--bg-white);
  --color-border-subtle:  rgba(2, 8, 23, 0.07);
  --color-border:         rgba(2, 8, 23, 0.12);
}

.section-muted {
  background: var(--bg-muted);
  color: var(--text-primary);
  --color-text-primary:   var(--text-primary);
  --color-text-secondary: var(--text-secondary);
  --color-text-muted:     var(--text-muted);
  --color-bg-elevated:    var(--bg-white);
  --color-border-subtle:  rgba(2, 8, 23, 0.08);
  --color-border:         rgba(2, 8, 23, 0.14);
}

/* =========================================================
 * VARIANTES DE SEÇÃO — escuras
 * ========================================================= */

.section-dark {
  background: var(--bg-dark);
  color: var(--text-inverse);
  --color-text-primary:   var(--text-inverse);
  --color-text-secondary: var(--text-inverse-muted);
  --color-text-muted:     rgba(255, 255, 255, 0.5);
  --color-bg-elevated:    rgba(255, 255, 255, 0.05);
  --color-border-subtle:  rgba(255, 255, 255, 0.07);
  --color-border:         rgba(255, 255, 255, 0.12);
}

.section-navy {
  background: var(--bg-navy);
  color: var(--text-inverse);
  --color-text-primary:   var(--text-inverse);
  --color-text-secondary: var(--text-inverse-muted);
  --color-text-muted:     rgba(255, 255, 255, 0.5);
  --color-bg-elevated:    rgba(255, 255, 255, 0.05);
  --color-border-subtle:  rgba(255, 255, 255, 0.07);
  --color-border:         rgba(255, 255, 255, 0.12);
}

.section-gradient-primary {
  background: var(--linear-1);
  color: var(--text-inverse);
  --color-text-primary:   var(--text-inverse);
  --color-text-secondary: var(--text-inverse-muted);
  --color-text-muted:     rgba(255, 255, 255, 0.5);
  --color-border-subtle:  rgba(255, 255, 255, 0.10);
  --color-border:         rgba(255, 255, 255, 0.18);
}

.section-gradient-secondary {
  background: var(--linear-2);
  color: var(--text-inverse);
  --color-text-primary:   var(--text-inverse);
  --color-text-secondary: var(--text-inverse-muted);
  --color-text-muted:     rgba(255, 255, 255, 0.5);
  --color-border-subtle:  rgba(255, 255, 255, 0.10);
  --color-border:         rgba(255, 255, 255, 0.18);
}

/* Garante texto correto em seções escuras para descrições */
.section-dark .section-description,
.section-navy .section-description,
.section-gradient-primary .section-description,
.section-gradient-secondary .section-description {
  color: var(--text-inverse-muted);
}

/* Legado — compatibilidade */
.section-bg-primary   { background: var(--color-bg-primary); }
.section-bg-secondary { background: var(--color-bg-secondary); }
.section-bg-elevated  { background: var(--color-bg-elevated); }

/* =========================================================
 * ELEMENTO DECORATIVO W.SVG
 * Adicione .section-with-w-symbol a qualquer .section
 * ========================================================= */

.section-with-w-symbol {
  position: relative;
  overflow: hidden;
}

.section-with-w-symbol::before {
  content: "";
  position: absolute;
  width: clamp(220px, 34vw, 520px);
  height: clamp(220px, 34vw, 520px);
  right: -6%;
  top: 50%;
  transform: translateY(-50%);
  background-image: url("../img/logo/asset w.svg");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

.section-with-w-symbol > * {
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .section-with-w-symbol::before {
    opacity: 0.025;
    right: -28%;
    width: clamp(180px, 60vw, 300px);
    height: clamp(180px, 60vw, 300px);
  }
}

/* Variante posicionada no topo */
.section-with-w-symbol--top::before {
  top: 6%;
  transform: none;
}

/* =========================================================
 * SECTION HEADER
 * ========================================================= */

.section-header {
  max-width: 820px;
  margin-bottom: clamp(36px, 5vw, 64px);
}

.section-header.center,
.section-header--center {
  margin-inline: auto;
  text-align: center;
  max-width: 820px;
  margin-bottom: clamp(36px, 5vw, 64px);
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: var(--font-weight-xbold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-blue-brand);
  margin-bottom: 14px;
}

/* Linha decorativa antes do eyebrow */
.section-eyebrow::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 2px;
  background: var(--color-blue-brand);
  flex-shrink: 0;
}

/* Em seções escuras, eyebrow usa azul claro */
.section-dark .section-eyebrow,
.section-navy .section-eyebrow,
.section-gradient-primary .section-eyebrow,
.section-gradient-secondary .section-eyebrow {
  color: var(--color-blue-300);
}

.section-dark .section-eyebrow::before,
.section-navy .section-eyebrow::before,
.section-gradient-primary .section-eyebrow::before,
.section-gradient-secondary .section-eyebrow::before {
  background: var(--color-blue-300);
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3.5vw, 3rem);
  font-weight: var(--font-weight-bold);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.section-subtitle,
.section-description {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-top: 20px;
  max-width: 600px;
  text-wrap: balance;
}

/* Centraliza o bloco de descrição em contextos explicitamente centrados:
   - .section-header.center / .section-header--center (padrão design system)
   - containers de intro das páginas internas (terminam em "-intro" ou "-inner")
   NÃO aplica globalmente para não quebrar seções alinhadas à esquerda */
.section-header.center .section-subtitle,
.section-header.center .section-description,
.section-header--center .section-subtitle,
.section-header--center .section-description,
[class*="-intro"] .section-description,
[class*="-inner"] .section-description {
  margin-inline: auto;
}

/* =========================================================
 * GRID
 * ========================================================= */

.grid {
  display: grid;
  gap: var(--grid-gap);
}

/* Mobile-first: tudo em 1 coluna */
.grid-1  { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-2  { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-3  { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-4  { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }

/* Grid automático — quebra quando necessário */
.grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Spans para grid-12 */
.col-span-1  { grid-column: span 1; }
.col-span-2  { grid-column: span 2; }
.col-span-3  { grid-column: span 3; }
.col-span-4  { grid-column: span 4; }
.col-span-5  { grid-column: span 5; }
.col-span-6  { grid-column: span 6; }
.col-span-7  { grid-column: span 7; }
.col-span-8  { grid-column: span 8; }
.col-span-9  { grid-column: span 9; }
.col-span-10 { grid-column: span 10; }
.col-span-11 { grid-column: span 11; }
.col-span-12 { grid-column: span 12; }

@media (max-width: 767px) {
  [class*="col-span-"] { grid-column: span 12; }
  .grid-12 { grid-template-columns: 1fr; }
}

/* Flex layouts */
.flex           { display: flex; }
.flex-col       { flex-direction: column; }
.flex-wrap      { flex-wrap: wrap; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.items-end      { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }
.gap-12 { gap: var(--space-12); }

/* =========================================================
 * HERO
 * ========================================================= */

.section-hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: var(--color-navy-950);
  padding-top: clamp(100px, 12vw, 160px);
  padding-bottom: clamp(64px, 8vw, 120px);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-navy-950) 0%, rgba(2,8,23,0.85) 60%, rgba(6,20,46,0.7) 100%);
  z-index: 1;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.hero-bg-pattern {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(33, 56, 100, 0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(33, 56, 100, 0.25) 1px, transparent 1px);
  background-size: 64px 64px;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-blue-200);
  margin-bottom: var(--space-6);
}

.hero-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 7vw, var(--text-7xl));
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  line-height: 0.98;
  letter-spacing: -0.05em;
  margin-bottom: var(--space-6);
}

.hero-title-accent {
  color: var(--color-blue-300);
  display: block;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.5vw, var(--text-xl));
  color: var(--text-inverse-muted);
  line-height: 1.7;
  max-width: 560px;
  margin-bottom: var(--space-10);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
}

.hero-stats {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  padding-top: var(--space-12);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  margin-top: var(--space-12);
}

.hero-stat { display: flex; flex-direction: column; }

.hero-stat-value {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3vw, var(--text-3xl));
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  line-height: 1;
}

.hero-stat-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-inverse-muted);
  margin-top: var(--space-2);
}

/* =========================================================
 * LOGO GRID (clientes / parceiros)
 * ========================================================= */

.logo-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-8) var(--space-12);
}

.logo-grid-item {
  opacity: 0.45;
  filter: grayscale(100%);
  transition:
    opacity var(--transition-base),
    filter var(--transition-base);
}

.logo-grid-item:hover {
  opacity: 1;
  filter: grayscale(0%);
}

/* =========================================================
 * CTA BAND
 * ========================================================= */

.cta-band {
  position: relative;
  padding: clamp(72px, 8vw, 120px) 0;
  background: var(--linear-1);
  overflow: hidden;
  text-align: center;
}

.cta-band-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, var(--text-4xl));
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
}

.cta-band-subtitle {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.4vw, var(--text-lg));
  color: var(--text-inverse-muted);
  margin-bottom: var(--space-8);
  max-width: 500px;
  margin-inline: auto;
  line-height: 1.7;
}

/* =========================================================
 * FOOTER
 * ========================================================= */

.footer {
  background: var(--color-navy-950);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: clamp(64px, 8vw, 96px) 0 var(--space-8);
}

.footer-grid {
  display: grid;
  gap: var(--space-10);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

.footer-brand { max-width: 300px; }

.footer-brand-logo {
  height: 36px;
  width: auto;
  margin-bottom: var(--space-4);
}

.footer-brand-name {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-3);
}

.footer-slogan {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-inverse-muted);
  line-height: 1.6;
  font-style: italic;
  margin-bottom: var(--space-6);
}

.footer-description {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-inverse-muted);
  line-height: 1.7;
}

.footer-social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--text-inverse-muted);
  text-decoration: none;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.footer-social-link:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--color-white);
}

.footer-col-title {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-inverse-muted);
  margin-bottom: var(--space-5);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2); /* reduzido de space-3 para space-2 — espaçamento mais compacto */
}

.footer-link {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-link:hover { color: var(--color-white); }

/* Link com ícone inline (WhatsApp, e-mail, etc.) */
.footer-link-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-link-icon svg {
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity var(--transition-fast);
}

.footer-link-icon:hover svg {
  opacity: 1;
}

.footer-bottom {
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

.footer-copyright {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.35);
}

/* =========================================================
 * UTILITÁRIOS — espaçamento e display
 * ========================================================= */

.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mt-16 { margin-top: var(--space-16); }

.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

.pt-8  { padding-top: var(--space-8); }
.pb-8  { padding-bottom: var(--space-8); }
.p-6   { padding: var(--space-6); }
.p-8   { padding: var(--space-8); }

.hidden   { display: none; }
.block    { display: block; }
.relative { position: relative; }

/* Visibilidade responsiva */
@media (max-width: 767px) {
  .hide-mobile { display: none !important; }
}

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

@media (min-width: 1024px) {
  .hide-desktop      { display: none !important; }
  .show-mobile-only  { display: none !important; }
}

/* Background utilitários */
.bg-navy     { background: var(--color-bg-primary); }
.bg-navy-alt { background: var(--color-bg-secondary); }
.bg-elevated { background: var(--color-bg-elevated); }
.bg-accent   { background: var(--color-accent); }
.bg-white    { background: var(--bg-white); }
.bg-light    { background: var(--bg-light); }
.bg-muted    { background: var(--bg-muted); }

/* =========================================================
 * HERO GRID — compartilhado entre Home e páginas internas
 * Adicione .page-hero à section hero de cada página interna.
 * home.css sobrescreve os estilos específicos da Home.
 * ========================================================= */

.hero-bg-grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.hero-bg-grid-svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.05;
}

.hero-bg-grid-reveal {
  opacity: 0.2;
  mask-image: radial-gradient(
    300px circle at var(--mouse-x, -9999px) var(--mouse-y, -9999px),
    black 0%,
    transparent 100%
  );
  -webkit-mask-image: radial-gradient(
    300px circle at var(--mouse-x, -9999px) var(--mouse-y, -9999px),
    black 0%,
    transparent 100%
  );
}

.hero-glows {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
}

.hero-glow-1 {
  width: 42%;
  height: 42%;
  left: -8%;
  bottom: -15%;
  background: rgba(33, 56, 100, 0.28);
}

.hero-glow-2 {
  width: 32%;
  height: 32%;
  right: 8%;
  top: -8%;
  background: rgba(140, 171, 214, 0.07);
}

/* Eleva o container acima das camadas decorativas */
.page-hero > .container {
  position: relative;
  z-index: 10;
}
