/**
 * Ponte visual Portal da Boa Vista → BPO Aurion
 * Mesmas classes do portal (header-fixed, hero-bg, card-premium, …) com tokens navy/dourado Aurion.
 */

:root {
  --brand-900: #0a1628;
  --brand-800: #102946;
  --brand-700: #163559;
  --olive-400: #c9ab5e;
  --olive-300: #e3d2a8;
  --olive-500: #927622;
  --surface: #f6f7f9;
  --surface-warm: #eef0f4;
  --organic-curve: ellipse(85% 60% at 50% 0%);
}

html {
  scroll-behavior: smooth;
}

.portal-bv-skin {
  font-family: "DM Sans", system-ui, sans-serif;
  background-color: var(--surface);
  color: var(--brand-900);
}

.font-display {
  font-family: "Cormorant Garamond", Georgia, serif;
}

/**
 * Logo institucional (PNG em alta resolução)
 * object-fit: contain + limites de altura/largura evitam estourar o header em telas estreitas.
 */
.site-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

/* Header: icon SVG + HTML wordmark (fonts + contrast; avoids img+SVG text quirks) */
.site-brand {
  max-width: min(12.5rem, 72vw);
}

@media (min-width: 640px) {
  .site-brand {
    max-width: min(14rem, 40vw);
  }
}

@media (min-width: 1024px) {
  .site-brand {
    max-width: 17.5rem;
  }
}

.site-brand__mark {
  display: block;
}

.site-logo--header {
  max-height: 2.5rem; /* 40px */
  max-width: min(11.5rem, 38vw);
}

@media (min-width: 768px) {
  .site-logo--header {
    max-height: 3rem; /* 48px */
    max-width: min(15rem, 32vw);
  }
}

@media (min-width: 1024px) {
  .site-logo--header {
    max-height: 3.25rem; /* 52px */
    max-width: 17rem;
  }
}

.site-logo--footer {
  max-height: 3.25rem;
  max-width: min(16rem, 85%);
  object-position: left center;
}

@media (min-width: 768px) {
  .site-logo--footer {
    max-height: 3.75rem;
    max-width: 18rem;
  }
}

.site-logo--modal {
  max-height: 3.5rem;
  max-width: min(14rem, 75vw);
  object-position: center;
}

@media (min-width: 480px) {
  .site-logo--modal {
    max-height: 4rem;
    max-width: 16rem;
  }
}

/* Curvas orgânicas no fundo (eco da logo) */
.organic-blob {
  position: absolute;
  border-radius: 60% 40% 50% 50% / 50% 45% 55% 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
}

.organic-footer-bg {
  background-image: radial-gradient(
      ellipse 120% 80% at 10% 0%,
      rgba(201, 171, 90, 0.25) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse 100% 60% at 90% 100%,
      rgba(15, 39, 68, 0.4) 0%,
      transparent 50%
    );
}

/* Header estados */
.header-fixed {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(10, 22, 40, 0.06);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.header-fixed.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: rgba(10, 22, 40, 0.08);
  box-shadow: 0 8px 32px rgba(10, 22, 40, 0.06);
}

.nav-link {
  position: relative;
  border-radius: 9999px;
  transition: color 0.25s ease, background 0.25s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--olive-400), var(--brand-700));
  transform: translateX(-50%);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-link:hover::after {
  width: 55%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-800) 0%, #163559 100%);
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1e4773 0%, var(--brand-800) 100%);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none !important;
}

/* Hero */
.hero-bg {
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  background: linear-gradient(
      120deg,
      rgba(10, 22, 40, 0.88) 0%,
      rgba(10, 22, 40, 0.45) 45%,
      rgba(15, 39, 68, 0.55) 100%
    ),
    linear-gradient(to top, rgba(10, 22, 40, 0.75), transparent 40%);
}

/* Hero Aurion — foto (dados / operação) + camadas navy/dourado por cima */
.aurion-hero-bg-portal {
  background-color: #0a1628;
  background-image:
    radial-gradient(ellipse 90% 70% at 12% 12%, rgba(201, 171, 90, 0.22), transparent 52%),
    radial-gradient(ellipse 70% 55% at 88% 25%, rgba(30, 71, 115, 0.35), transparent 48%),
    linear-gradient(168deg, rgba(3, 9, 16, 0.72) 0%, rgba(10, 22, 40, 0.55) 42%, rgba(16, 39, 57, 0.68) 100%),
    url("../img/hero-business-bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* CTA “Explorar” — movimento contínuo suave (flutuante) */
.hero-explore-float {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: hero-explore-float 2.8s ease-in-out infinite;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
  will-change: transform;
}

.hero-explore-float i {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

@keyframes hero-explore-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-explore-float {
    animation: none;
  }
}

/* Cards institucionais / estrutura */
.card-premium {
  border-radius: 1.25rem;
  border: 1px solid rgba(10, 22, 40, 0.07);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(246, 247, 249, 0.92) 100%
  );
  box-shadow: 0 4px 24px rgba(10, 22, 40, 0.05);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.45s ease, border-color 0.35s ease;
}

.card-premium:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(10, 22, 40, 0.1);
  border-color: rgba(201, 171, 90, 0.45);
}

.card-premium .card-icon-wrap {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.35s ease, color 0.35s ease;
}

.card-premium:hover .card-icon-wrap {
  transform: scale(1.08) rotate(-3deg);
  background: rgba(15, 39, 68, 0.12);
  color: var(--brand-800);
}

/* Notícias */
.news-card {
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid rgba(10, 22, 40, 0.08);
  background: #fff;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s ease;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(10, 22, 40, 0.09);
}

.news-card .news-read {
  transition: gap 0.3s ease, color 0.25s ease;
}

.news-card:hover .news-read {
  gap: 0.5rem;
  color: var(--brand-800);
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Modais */
.modal.modal-visible {
  display: flex;
}

.modal-panel {
  animation: modalIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Detalhe da ocorrência (modal sobre o painel do morador) */
#occurrence-detail-layer:not(.hidden) {
  display: flex;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-backdrop {
  animation: fadeIn 0.35s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Loader (pontos) */
.loader-dots {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 14px 0 currentColor, -14px 0 currentColor;
  animation: loaderPulse 0.9s infinite linear alternate;
}

@keyframes loaderPulse {
  0% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Skeleton */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(236, 239, 244, 0.9) 25%,
    rgba(255, 255, 255, 0.95) 50%,
    rgba(236, 239, 244, 0.9) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Toasts */
#toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  border-radius: 1rem;
  padding: 0.875rem 1.125rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 12px 40px rgba(10, 22, 40, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  animation: toastIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.toast-success {
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand-800);
  border-left: 4px solid var(--olive-500);
}

.toast-error {
  background: rgba(254, 242, 242, 0.95);
  color: #991b1b;
  border-left: 4px solid #dc2626;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* WhatsApp flutuante */
#whatsapp-float {
  position: fixed;
  bottom: 5.5rem;
  right: 1.25rem;
  z-index: 90;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 8px 28px rgba(18, 140, 126, 0.45);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.35s ease;
}

#whatsapp-float:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 36px rgba(18, 140, 126, 0.55);
}

/* Voltar ao topo */
#btn-back-top {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 89;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 39, 68, 0.92);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.35s ease, visibility 0.35s, transform 0.35s ease,
    background 0.25s ease;
}

#btn-back-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#btn-back-top:hover {
  background: var(--brand-700);
}

/* Status badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
}

.badge-recebido {
  background: rgba(201, 171, 90, 0.25);
  color: var(--brand-800);
}

.badge-analise {
  background: rgba(251, 191, 36, 0.2);
  color: #92400e;
}

.badge-finalizado {
  background: rgba(34, 197, 94, 0.15);
  color: #166534;
}

/* Histórico item */
.request-item {
  border-radius: 1rem;
  border: 1px solid rgba(10, 22, 40, 0.08);
  background: rgba(255, 255, 255, 0.75);
  padding: 1rem 1.125rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.request-item:hover {
  border-color: rgba(201, 171, 90, 0.35);
  box-shadow: 0 8px 24px rgba(10, 22, 40, 0.06);
}

.request-item--clickable {
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.request-item--clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(10, 22, 40, 0.1);
}

.request-item--clickable:focus-visible {
  outline: 2px solid var(--olive-400);
  outline-offset: 2px;
}

/* Mobile menu link */
.mobile-nav-link {
  transition: background 0.25s ease, color 0.25s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus-visible {
  background: rgba(15, 39, 68, 0.06);
}

/* Acessibilidade: foco visível */
:focus-visible {
  outline: 2px solid var(--olive-400);
  outline-offset: 2px;
}

/* Reduzir movimento */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
