/* ==========================================================================
   EDNEI ROCHA ADVOCACIA - ESTILOS INSTITUCIONAIS & MICROINTERAÇÕES
   Paleta: Azul Profundo & Prata Metálico | Design Minimalista & Moderno
   ========================================================================== */

:root {
  --brand-dark: #070F1E;
  --brand-navy: #0B192C;
  --brand-navy-card: #0F2038;
  --brand-navy-border: rgba(226, 232, 240, 0.12);
  --brand-silver: #E2E8F0;
  --brand-silver-light: #F8FAFC;
  --brand-silver-muted: #94A3B8;
  --brand-silver-dark: #64748B;
  
  --silver-gradient: linear-gradient(135deg, #FFFFFF 0%, #E2E8F0 40%, #CBD5E1 100%);
  --silver-gradient-hover: linear-gradient(135deg, #FFFFFF 0%, #F1F5F9 50%, #E2E8F0 100%);
  --silver-glow: 0 0 20px rgba(226, 232, 240, 0.22);
  --silver-border: rgba(226, 232, 240, 0.28);
  --silver-border-hover: rgba(226, 232, 240, 0.7);
  
  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-slow: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Hero Background & Viewport --- */
.hero-fullscreen {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

/* Camada externa: controla a entrada (fade + zoom-out) via [data-animate], sem interferir no zoom contínuo */
.hero-bg-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

/* Camada interna: zoom contínuo e bidirecional (aproxima e afasta em loop, tipo Ken Burns) */
.hero-bg-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../img/hero-bg.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  animation: heroBgBreathe 22s ease-in-out infinite alternate;
}

@keyframes heroBgBreathe {
  0% { transform: scale(1); }
  100% { transform: scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-bg-photo::after {
    animation: none;
  }
}

.hero-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(to bottom, rgba(7, 15, 30, 0.65) 0%, rgba(7, 15, 30, 0.4) 15%, rgba(7, 15, 30, 0.85) 100%),
    linear-gradient(to right, rgba(7, 15, 30, 0.95) 0%, rgba(7, 15, 30, 0.88) 100%);
}

@media (min-width: 1024px) {
  .hero-bg-photo::after {
    background-position: right center;
  }

  .hero-bg-overlay {
    background-image:
      linear-gradient(to bottom, rgba(7, 15, 30, 0.6) 0%, transparent 16%, transparent 85%, #070F1E 100%),
      linear-gradient(to right, #070F1E 0%, #070F1E 48%, rgba(7, 15, 30, 0.94) 64%, rgba(7, 15, 30, 0.72) 82%, rgba(7, 15, 30, 0.42) 100%);
  }
}

/* --- Botões Prateados & Efeitos de Destaque --- */
.btn-silver {
  background: var(--silver-gradient) !important;
  color: #070F1E !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 4px 14px rgba(226, 232, 240, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  transition: all 0.35s var(--ease-premium) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-silver:hover {
  background: var(--silver-gradient-hover) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(226, 232, 240, 0.28), inset 0 1px 0 #FFFFFF !important;
}

.btn-silver-outline {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--brand-silver) !important;
  border: 1px solid var(--silver-border) !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  transition: all 0.35s var(--ease-premium) !important;
  backdrop-filter: blur(8px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-silver-outline:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: var(--silver-border-hover) !important;
  color: #FFFFFF !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
}

/* --- Badges & Destaques em Prata --- */
.badge-silver {
  background: rgba(226, 232, 240, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.22);
  color: var(--brand-silver);
  border-radius: 4px;
}

.text-silver {
  color: var(--brand-silver);
}

.text-silver-muted {
  color: var(--brand-silver-muted);
}

.border-silver-subtle {
  border-color: rgba(226, 232, 240, 0.15);
}

/* --- Hover de Elevação para Quadrados, Divs e Cards (Transição Macia & Fluida) --- */
.hover-elevate {
  position: relative;
  z-index: 1;
  transition: transform 0.32s var(--ease-premium), box-shadow 0.32s var(--ease-premium), border-color 0.32s var(--ease-premium), background-color 0.32s var(--ease-premium);
  will-change: transform, box-shadow;
}

.hover-elevate:hover,
.hover-elevate:focus-within,
.hover-elevate:focus-visible {
  transform: translateY(-4px);
  z-index: 25;
  box-shadow: 0 16px 32px -6px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(226, 232, 240, 0.28), 0 0 20px rgba(226, 232, 240, 0.08);
}

/* --- Hover de Elevação para Seções Claras --- */
.hover-elevate-light {
  position: relative;
  z-index: 1;
  transition: transform 0.32s var(--ease-premium), box-shadow 0.32s var(--ease-premium), border-color 0.32s var(--ease-premium), background-color 0.32s var(--ease-premium);
  will-change: transform, box-shadow;
}

.hover-elevate-light:hover,
.hover-elevate-light:focus-within,
.hover-elevate-light:focus-visible {
  transform: translateY(-4px);
  z-index: 25;
  box-shadow: 0 16px 30px -6px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04), 0 0 0 1px rgba(15, 23, 42, 0.06);
}

/* --- Elevação Suave Específica para Itens do FAQ --- */
.faq-item.hover-elevate:hover,
.faq-item.hover-elevate:focus-within,
.faq-item.hover-elevate:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(226, 232, 240, 0.2);
}

/* --- Grids Contíguos com Preservação de Cantos sem Overflow-Hidden --- */
.grid-contiguous {
  border-radius: 4px;
}

@media (min-width: 1024px) {
  .grid-contiguous-4 > *:first-child { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
  .grid-contiguous-4 > *:last-child { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
  .grid-contiguous-3 > *:first-child { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
  .grid-contiguous-3 > *:last-child { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .grid-contiguous-4 > *:nth-child(1) { border-top-left-radius: 4px; }
  .grid-contiguous-4 > *:nth-child(2) { border-top-right-radius: 4px; }
  .grid-contiguous-4 > *:nth-child(3) { border-bottom-left-radius: 4px; }
  .grid-contiguous-4 > *:nth-child(4) { border-bottom-right-radius: 4px; }
  .grid-contiguous-3 > *:first-child { border-top-left-radius: 4px; }
  .grid-contiguous-3 > *:last-child { border-bottom-right-radius: 4px; }
}

@media (min-width: 768px) {
  .grid-contiguous-2 > *:nth-child(1) { border-top-left-radius: 4px; }
  .grid-contiguous-2 > *:nth-child(2) { border-top-right-radius: 4px; }
  .grid-contiguous-2 > *:nth-child(3) { border-bottom-left-radius: 4px; }
  .grid-contiguous-2 > *:nth-child(4) { border-bottom-right-radius: 4px; }
}

@media (max-width: 767px) {
  .grid-contiguous > *:first-child { border-top-left-radius: 4px; border-top-right-radius: 4px; }
  .grid-contiguous > *:last-child { border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; }
}

/* --- Animações Bidirecionais em Cascata (entrada moderna: fade + slide + leve escala) --- */
[data-animate="cascade"] {
  opacity: 0;
  transform: translateY(-22px) scale(0.98);
  transition: opacity 0.7s var(--ease-slow), transform 0.7s var(--ease-slow);
  will-change: opacity, transform;
}

[data-animate="cascade"].is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Variação de cascata para elementos que entram de baixo */
[data-animate="cascade-up"] {
  opacity: 0;
  transform: translateY(22px) scale(0.98);
  transition: opacity 0.7s var(--ease-slow), transform 0.7s var(--ease-slow);
  will-change: opacity, transform;
}

[data-animate="cascade-up"].is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Variação para imagens: zoom-out bidirecional (entra ampliada e reduz até a escala natural) */
[data-animate="zoom-out"] {
  opacity: 0;
  transform: scale(1.16);
  transition: opacity 0.9s var(--ease-slow), transform 0.9s var(--ease-slow);
  will-change: opacity, transform;
}

[data-animate="zoom-out"].is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Delays em Cascata */
.delay-100 { transition-delay: 0.08s; }
.delay-200 { transition-delay: 0.16s; }
.delay-300 { transition-delay: 0.24s; }
.delay-400 { transition-delay: 0.32s; }
.delay-500 { transition-delay: 0.40s; }
.delay-600 { transition-delay: 0.48s; }

/* --- Balão Amigável de Chat WhatsApp com Botão 'X' Externo --- */
.whatsapp-chat-balloon {
  border-radius: 20px 20px 4px 20px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45), 0 0 1px 1px rgba(255, 255, 255, 0.1);
  position: relative;
}

/* --- Balão de Inatividade WhatsApp (Chat Branco Amigável & Bico Pontiagudo) --- */
.whatsapp-tooltip-container {
  position: relative;
  margin-bottom: 8px;
  margin-right: 14px;
  max-width: calc(100vw - 84px);
  transition: opacity 0.3s var(--ease-premium), transform 0.3s var(--ease-premium);
}

#whatsapp-chat-panel.opacity-0 {
  margin-bottom: 0 !important;
  border-width: 0 !important;
}

.whatsapp-tooltip-balloon {
  background-color: #FFFFFF;
  color: #0F172A;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 10px 16px;
  border-radius: 18px 18px 3px 18px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 4px 10px -2px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s var(--ease-premium), box-shadow 0.2s var(--ease-premium);
}

.whatsapp-tooltip-balloon:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -4px rgba(0, 0, 0, 0.3), 0 6px 12px -2px rgba(0, 0, 0, 0.15);
}

.whatsapp-tooltip-close {
  position: absolute;
  top: -8px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: #FFFFFF;
  color: #64748B;
  border: 1px solid #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: all 0.2s var(--ease-premium);
  z-index: 60;
  pointer-events: auto !important;
}

.whatsapp-tooltip-close svg,
.whatsapp-tooltip-close path {
  pointer-events: none;
}

.whatsapp-tooltip-close:hover {
  background-color: #F8FAFC;
  color: #0F172A;
  border-color: #94A3B8;
  transform: scale(1.15);
}

.whatsapp-tooltip-close::before {
  content: '';
  position: absolute;
  inset: -10px;
  pointer-events: auto !important;
}

.whatsapp-close-external {
  position: absolute;
  top: -12px;
  right: -10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #070F1E;
  color: #E2E8F0;
  border: 1.5px solid rgba(226, 232, 240, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: all 0.25s var(--ease-premium);
  z-index: 60;
}

.whatsapp-close-external:hover {
  background-color: #12233E;
  color: #FFFFFF;
  transform: scale(1.1);
  border-color: #FFFFFF;
}

/* --- Áreas de Atuação: Menu Lateral + Painel --- */
.area-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 20px 24px;
  border-radius: 6px;
  background: transparent;
  color: var(--brand-silver-muted);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s var(--ease-premium), color 0.3s var(--ease-premium);
  text-align: left;
  min-height: 60px;
}

.area-menu-item:hover,
.area-menu-item.is-active {
  background-color: rgba(226, 232, 240, 0.08);
  color: #FFFFFF;
}

.area-menu-item .area-menu-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: rgba(226, 232, 240, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.3s var(--ease-premium);
}

.area-menu-item.is-active .area-menu-icon,
.area-menu-item:hover .area-menu-icon {
  background: rgba(226, 232, 240, 0.12);
}

.area-panel {
  display: none;
}

.area-panel.is-active {
  display: block;
  animation: areaPanelIn 0.4s var(--ease-premium) both;
}

@keyframes areaPanelIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile: painéis empilhados, todos visíveis */
@media (max-width: 767px) {
  .area-panel {
    display: block;
    animation: none;
  }
}

/* --- Rodapé Expandido (Conforme footer.md) --- */
.site-footer-expanded {
  background-color: var(--brand-dark);
  color: var(--brand-silver-muted);
  padding: 100px 24px 56px 24px;
}

.footer-divider-thin {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.08);
  border: none;
  margin: 56px 0 32px 0;
}

.footer-link-hover {
  transition: color 0.25s var(--ease-premium), transform 0.25s var(--ease-premium);
  display: inline-block;
}

.footer-link-hover:hover {
  color: #FFFFFF;
  transform: translateX(3px);
}

/* --- Sublinhado Interativo Navbar (Expansão do Centro para as Pontas) --- */
#site-header nav a:not(.btn-silver),
#mobile-nav-panel nav a:not(.btn-silver) {
  position: relative;
  display: inline-block;
  width: fit-content;
}

#site-header nav a:not(.btn-silver)::after,
#mobile-nav-panel nav a:not(.btn-silver)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1.5px;
  background-color: var(--brand-silver);
  box-shadow: 0 0 6px rgba(226, 232, 240, 0.4);
  border-radius: 9999px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease-premium), opacity 0.3s var(--ease-premium);
  opacity: 0;
  pointer-events: none;
}

#site-header nav a:not(.btn-silver):hover::after,
#site-header nav a:not(.btn-silver):focus-visible::after,
#mobile-nav-panel nav a:not(.btn-silver):hover::after,
#mobile-nav-panel nav a:not(.btn-silver):focus-visible::after {
  transform: scaleX(1);
  opacity: 1;
}

/* ==========================================================================
   AVISO DE COOKIES (LGPD) - BANNER, MODAL DE PREFERÊNCIAS & BOTÃO FLUTUANTE
   ========================================================================== */
#cookie-consent-banner {
  position: fixed;
  left: 20px;
  bottom: 100px;
  z-index: 9999;
  width: calc(100% - 40px);
  max-width: 340px;
  background: var(--brand-navy);
  border: 1px solid var(--brand-navy-border);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  padding: 22px;
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  transition: transform 0.5s var(--ease-slow), opacity 0.5s var(--ease-slow);
  pointer-events: none;
}

#cookie-consent-banner.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.cookie-banner-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

.cookie-banner-text {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--brand-silver-muted);
}

.cookie-banner-text strong {
  color: #FFFFFF;
}

.cookie-banner-text a {
  color: var(--brand-silver);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.25s var(--ease-premium);
}

.cookie-banner-text a:hover {
  color: #FFFFFF;
}

.cookie-banner-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.cookie-banner-actions .btn-silver,
.cookie-banner-actions .btn-silver-outline {
  width: 100%;
}

.btn-cookie-text {
  background: transparent !important;
  color: var(--brand-silver-muted) !important;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 0;
  border: none;
  align-self: flex-start;
  transition: color 0.25s var(--ease-premium);
  cursor: pointer;
}

.btn-cookie-text:hover {
  color: #FFFFFF !important;
}

/* --- Overlay & Modal de Preferências --- */
#cookie-preferences-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(7, 15, 30, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-premium);
}

#cookie-preferences-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.cookie-modal {
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--brand-navy);
  border: 1px solid var(--brand-navy-border);
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  padding: 32px;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.35s var(--ease-premium);
}

#cookie-preferences-overlay.is-visible .cookie-modal {
  transform: translateY(0) scale(1);
}

.cookie-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.cookie-modal-close {
  background: transparent;
  border: none;
  color: var(--brand-silver-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 0;
  transition: color 0.25s var(--ease-premium);
}

.cookie-modal-close:hover {
  color: #FFFFFF;
}

.cookie-category {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.cookie-category-title {
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.cookie-category-desc {
  color: var(--brand-silver-muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

/* --- Toggle Switch (Prata) --- */
.cookie-switch {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  margin-top: 2px;
}

.cookie-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-switch-track {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--silver-border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s var(--ease-premium);
}

.cookie-switch-track::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  top: 3px;
  background: var(--brand-silver-muted);
  border-radius: 50%;
  transition: transform 0.25s var(--ease-premium), background 0.25s var(--ease-premium);
}

.cookie-switch input:checked + .cookie-switch-track {
  background: rgba(226, 232, 240, 0.28);
  border-color: var(--silver-border-hover);
}

.cookie-switch input:checked + .cookie-switch-track::before {
  transform: translateX(20px);
  background: var(--silver-gradient);
}

.cookie-switch input:disabled + .cookie-switch-track {
  cursor: not-allowed;
  opacity: 0.6;
}

.cookie-modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Botão Flutuante "Preferências de Cookies" (reabrir a qualquer momento) --- */
#cookie-settings-trigger {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 40;
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--brand-navy);
  border: 1px solid var(--brand-navy-border);
  color: var(--brand-silver-muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: color 0.25s var(--ease-premium), border-color 0.25s var(--ease-premium), transform 0.25s var(--ease-premium);
}

#cookie-settings-trigger.is-visible {
  display: inline-flex;
}

#cookie-settings-trigger:hover {
  color: #FFFFFF;
  border-color: var(--silver-border-hover);
  transform: translateY(-2px);
}

@media (max-width: 480px) {
  #cookie-consent-banner {
    right: 12px;
    left: 12px;
    bottom: 90px;
    width: auto;
    max-width: none;
  }

  .whatsapp-tooltip-balloon {
    display: none;
  }

  #cookie-settings-trigger {
    left: 12px;
    bottom: 12px;
    padding: 8px 12px;
  }
}
