/* ================================================================
   CUSTOM CSS — Costa & Guimarães Advocacia
   Cores: #152f50 (Azul) · #edbc6f (Dourado)
================================================================ */

/* ---- Variáveis ---- */
:root {
  --primary:      #152f50;
  --primary-light:#1e4a7a;
  --primary-dark: #0d1f36;
  --gold:         #edbc6f;
  --gold-light:   #f5d899;
  --gold-dark:    #c99a45;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

@media (min-width: 1024px) {
  html { scroll-padding-top: 112px; } /* altura do header lg:h-28 */
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--primary-dark); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

/* ---- Focus ---- */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ================================================================
   HEADER / NAVEGAÇÃO
================================================================ */
#header {
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
}

#header:not(.scrolled) {
  background: transparent;
}

#header.scrolled {
  background-color: var(--primary);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.nav-link {
  position: relative;
  color: rgba(255, 255, 255, 0.85);
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active { color: var(--gold); }

.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

/* Hamburger bars */
.menu-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#header.scrolled .menu-bar { background: white; }

/* ================================================================
   HERO
================================================================ */
.hero-pattern {
  background-image: radial-gradient(circle, rgba(255,255,255,0.35) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
}

/* Floating circles decoration */
@keyframes float-a {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-18px); }
}
@keyframes float-b {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

.float-a { animation: float-a 9s ease-in-out infinite; }
.float-b { animation: float-b 7s ease-in-out infinite; animation-delay: -3s; }
.float-c { animation: float-a 5s ease-in-out infinite; animation-delay: -1.5s; }

/* ================================================================
   SEÇÕES — REVEAL ANIMATION (Intersection Observer)
================================================================ */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* Stagger para itens de grid */
.reveal-grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal-grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal-grid .reveal:nth-child(4) { transition-delay: 0.24s; }

/* ================================================================
   ÁREAS DE ATUAÇÃO — cards
================================================================ */
.area-card {
  transition: transform 0.25s ease, background-color 0.25s ease,
              border-color 0.25s ease, box-shadow 0.25s ease;
}

.area-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(237, 188, 111, 0.2);
}

/* ================================================================
   FORMULÁRIO DE CONTATO
================================================================ */
.form-input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(237, 188, 111, 0.2);
  outline: none;
}

.form-input.error {
  border-color: #f87171 !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

/* Select seta customizada */
select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}

/* ================================================================
   BOTÃO WHATSAPP FLUTUANTE
================================================================ */
#whatsapp-fab {
  transition: transform 0.3s ease, background-color 0.3s ease;
}

#whatsapp-fab:hover { transform: scale(1.12); }

/* Pulse ring */
@keyframes fab-pulse {
  0%   { transform: scale(1);   opacity: 0.5; }
  70%  { transform: scale(1.6); opacity: 0;   }
  100% { transform: scale(1.6); opacity: 0;   }
}

.fab-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #edbc6f;
  animation: fab-pulse 2.5s ease-out infinite;
}

/* ================================================================
   VOLTAR AO TOPO
================================================================ */
#back-to-top {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
  pointer-events: none;
}

#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ================================================================
   CONTADOR
================================================================ */
.counter {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* ================================================================
   IMAGENS — fade-in suave
================================================================ */
img {
  transition: opacity 0.4s ease;
}

/* ================================================================
   DECORATIVO — linha dourada
================================================================ */
.gold-rule {
  width: 50px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
}

/* ================================================================
   SEÇÃO LABEL (chapéu de seção)
================================================================ */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
}

.section-label::before,
.section-label::after {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--gold);
  flex-shrink: 0;
}

/* ================================================================
   MOBILE MENU
================================================================ */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

#mobile-menu.open {
  max-height: 400px;
}

/* ================================================================
   LOADING SPINNER
================================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spin { animation: spin 0.7s linear infinite; }

/* ================================================================
   RESPONSIVO — ajustes extras
================================================================ */
@media (max-width: 640px) {
  #hero h1 { font-size: clamp(2rem, 8vw, 3.5rem); }
}

/* ================================================================
   IMPRESSÃO
================================================================ */
@media print {
  #header, #whatsapp-fab, #back-to-top, .no-print { display: none !important; }
  body { font-size: 12pt; color: #000; }
  a[href]::after { content: " (" attr(href) ")"; }
}
