/* =========================
   BOA CONNECT — ANIMAÇÕES E INTERATIVIDADE
   ========================= */

:root {
  /* Paleta principal */
  --bc-primary: #1976D2;
  --bc-primary-rgb: 25, 118, 210;
  --bc-primary-hover: #1565C0;
  --bc-primary-active: #0d47a1;
  --bc-primary-light: #42a5f5;
  --bc-primary-text: #ffffff;
  --bc-primary-shadow: 0 8px 22px rgba(var(--bc-primary-rgb), 0.28);
  --bc-primary-shadow-hover: 0 12px 28px rgba(var(--bc-primary-rgb), 0.35);

  /* Estados neutros */
  --bc-white: #ffffff;
  --bc-dark: #111827;
  --bc-gray: #6b7280;
  --bc-bg: #f8fafc;
  --bc-radius: 10px;
  --bc-radius-lg: 14px;
  --bc-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Logo global */
.nav .logo img {
  max-height: 50px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}
@media (max-width: 768px) {
  .nav .logo img { max-height: 42px; max-width: 180px; }
}

/* Animações base (Intersection Observer acrescenta .is-visible) */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}
.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-down {
  opacity: 0;
  transform: translateY(-30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}
.fade-down.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}
.fade-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}
.fade-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.zoom-in {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
  will-change: opacity, transform;
}
.zoom-in.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays — aplicar via style inline ou JS */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }

/* Header scrolled */
.menu.scrolled,
header.scrolled {
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

/* =========================
   DESIGN SYSTEM — BOTÕES
   ========================= */

/* Base */
.btn,
a.btn,
button.btn,
input.btn,
[type="submit"].btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border: 2px solid transparent;
  border-radius: var(--bc-radius);
  background: var(--bc-primary);
  color: var(--bc-primary-text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--bc-primary-shadow);
  transform: translateY(0) scale(1);
  transition: var(--bc-transition);
  transition-property: transform, background, border-color, color, box-shadow;
  will-change: transform;
  min-height: 46px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Brilho sutil no hover */
.btn::after,
a.btn::after,
button.btn::after,
[type="submit"].btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-20deg);
  transition: none;
  pointer-events: none;
}

.btn:hover::after,
a.btn:hover::after,
button.btn:hover::after,
[type="submit"].btn:hover::after {
  animation: btn-shine 0.65s ease-out;
}

@keyframes btn-shine {
  to { left: 130%; }
}

/* Hover / active / focus */
.btn:hover,
a.btn:hover,
button.btn:hover,
[type="submit"].btn:hover {
  background: var(--bc-primary-hover);
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--bc-primary-shadow-hover);
}

.btn:active,
a.btn:active,
button.btn:active,
[type="submit"].btn:active {
  background: var(--bc-primary-active);
  transform: translateY(0) scale(0.97);
  box-shadow: 0 4px 10px rgba(var(--bc-primary-rgb), 0.22);
  transition-duration: 0.08s;
}

.btn:focus-visible,
a.btn:focus-visible,
button.btn:focus-visible,
[type="submit"].btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--bc-primary-rgb), 0.3), var(--bc-primary-shadow-hover);
}

/* Ícones dentro do botão */
.btn svg,
.btn img {
  width: 18px;
  height: 18px;
  transition: var(--bc-transition);
}

.btn:hover svg,
.btn:hover img {
  transform: translateX(3px);
}

/* Tamanhos */
.btn-sm { padding: 9px 18px; min-height: 38px; font-size: 0.92rem; }
.btn-lg { padding: 16px 34px; min-height: 54px; font-size: 1.08rem; }
.btn-block { width: 100%; }

/* Botão secundário / outline */
.btn-outline,
a.btn-outline,
button.btn-outline {
  background: transparent;
  border-color: var(--bc-primary);
  color: var(--bc-primary);
  box-shadow: none;
}

.btn-outline:hover,
a.btn-outline:hover,
button.btn-outline:hover {
  background: var(--bc-primary);
  color: var(--bc-primary-text);
  border-color: var(--bc-primary);
  box-shadow: var(--bc-primary-shadow);
}

.btn-outline:active,
a.btn-outline:active,
button.btn-outline:active {
  background: var(--bc-primary-active);
  border-color: var(--bc-primary-active);
  color: var(--bc-primary-text);
}

/* Outline claro (fundo escuro) */
.btn-outline-light,
a.btn-outline-light,
button.btn-outline-light {
  background: transparent;
  border-color: var(--bc-white);
  color: var(--bc-white);
  box-shadow: none;
}

.btn-outline-light:hover,
a.btn-outline-light:hover,
button.btn-outline-light:hover {
  background: var(--bc-white);
  color: var(--bc-primary);
  border-color: var(--bc-white);
  box-shadow: 0 8px 22px rgba(0,0,0,0.18);
}

.btn-outline-light:active,
a.btn-outline-light:active,
button.btn-outline-light:active {
  transform: translateY(0) scale(0.97);
  background: #eef2f7;
}

/* Botão claro (fundo escuro) */
.btn-light,
a.btn-light,
button.btn-light {
  background: var(--bc-white);
  color: var(--bc-primary);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.btn-light:hover,
a.btn-light:hover,
button.btn-light:hover {
  background: #f1f5f9;
  color: var(--bc-primary);
  box-shadow: 0 10px 24px rgba(0,0,0,0.16);
}

.btn-light:active,
a.btn-light:active,
button.btn-light:active {
  background: #e2e8f0;
  transform: translateY(0) scale(0.97);
}

/* Botão/link texto */
.btn-text,
a.btn-text {
  background: transparent;
  color: var(--bc-primary);
  box-shadow: none;
  border: none;
  padding: 8px 4px;
  border-radius: 0;
  font-weight: 600;
  border-bottom: 2px solid transparent;
}

.btn-text:hover,
a.btn-text:hover {
  color: var(--bc-primary-hover);
  border-bottom-color: var(--bc-primary);
  transform: translateY(-1px);
}

.btn-text:active,
a.btn-text:active {
  color: var(--bc-primary-active);
  transform: translateY(0) scale(0.98);
}

/* Reduz movimento */
@media (prefers-reduced-motion: reduce) {
  .btn,
  a.btn,
  button.btn,
  [type="submit"].btn {
    transition: none !important;
    animation: none !important;
  }
  .btn::after,
  a.btn::after,
  button.btn::after,
  [type="submit"].btn::after {
    display: none;
  }
  .btn:hover,
  a.btn:hover,
  button.btn:hover,
  [type="submit"].btn:hover,
  .btn:active,
  a.btn:active,
  button.btn:active,
  [type="submit"].btn:active {
    transform: none;
  }
}

/* Botões antigos/substitutos de fallback */
button[type="submit"]:not(.btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border: 2px solid transparent;
  border-radius: var(--bc-radius);
  background: var(--bc-primary);
  color: var(--bc-primary-text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--bc-primary-shadow);
  transition: var(--bc-transition);
}

button[type="submit"]:not(.btn):hover {
  background: var(--bc-primary-hover);
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--bc-primary-shadow-hover);
}

button[type="submit"]:not(.btn):active {
  background: var(--bc-primary-active);
  transform: translateY(0) scale(0.97);
}

/* Active nav link */
.links a.active,
.menu-links a.active {
  color: #1976D2;
  font-weight: 700;
}

/* Botão do menu */
.menu-links a.btn,
.menu-links a.btn-sm {
  text-decoration: none;
  border: none;
}
.menu-links a.btn::after,
.menu-links a.btn-sm::after {
  display: none;
}

/* Cards */
.card,
.project,
.item,
.testemunho {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover,
.project:hover,
.item:hover,
.testemunho:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.12);
}
.card img,
.project img,
.item img {
  transition: transform 0.5s ease;
}
.card:hover img,
.project:hover img,
.item:hover img {
  transform: scale(1.05);
}

/* Menus */
.menu .links a,
.menu-links a,
.nav .menu-links a {
  position: relative;
  transition: color 0.3s ease;
}
.menu .links a::after,
.menu-links a::after,
.nav .menu-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #1976D2;
  transition: width 0.3s ease;
}
.menu .links a:hover::after,
.menu-links a:hover::after,
.nav .menu-links a:hover::after {
  width: 100%;
}

/* Hamburger animation */
.hamburger span {
  transition: transform 0.3s ease, opacity 0.3s ease;
}
#menu-toggle:checked ~ header .hamburger span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
#menu-toggle:checked ~ header .hamburger span:nth-child(2) {
  opacity: 0;
}
#menu-toggle:checked ~ header .hamburger span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Lightbox */
.cv-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.cv-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}
.cv-lightbox img,
.cv-lightbox video {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.cv-lightbox .close,
.cv-lightbox .prev,
.cv-lightbox .next {
  position: absolute;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.cv-lightbox .close:hover,
.cv-lightbox .prev:hover,
.cv-lightbox .next:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.1);
}
.cv-lightbox .close { top: 20px; right: 20px; }
.cv-lightbox .prev { left: 20px; top: 50%; transform: translateY(-50%); }
.cv-lightbox .next { right: 20px; top: 50%; transform: translateY(-50%); }

/* Counter animation helper */
.counter {
  font-variant-numeric: tabular-nums;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Carrossel / Slideshow */
.bc-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 16px;
}
.bc-carousel-slides {
  position: relative;
  width: 100%;
  height: 100%;
}
.bc-carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(60px) scale(0.96);
  transition: opacity 0.9s ease-in-out, transform 0.9s ease-in-out;
  pointer-events: none;
  z-index: 0;
}
.bc-carousel-slide.active {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
  z-index: 1;
}
.bc-carousel-slide.prev {
  opacity: 0.35;
  transform: translateX(-35%) scale(0.85);
  z-index: 0;
}
.bc-carousel-slide.next {
  opacity: 0.35;
  transform: translateX(35%) scale(0.85);
  z-index: 0;
}
.bc-carousel img,
.bc-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  border-radius: 16px;
  display: block;
}
.bc-carousel-nav {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}
.bc-carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.35);
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}
.bc-carousel-dot.active {
  background: #fff;
  transform: scale(1.2);
}
.bc-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  color: #1976D2;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  z-index: 5;
  transition: background 0.3s, transform 0.3s;
}
.bc-carousel-arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.08);
}
.bc-carousel-arrow.prev { left: 12px; }
.bc-carousel-arrow.next { right: 12px; }

.bc-carousel.triple {
  height: 280px;
  background: transparent;
  border-radius: 0;
}
.bc-carousel.triple .bc-carousel-slides {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.bc-carousel.triple .bc-carousel-slide {
  position: relative;
  flex: 0 0 26%;
  max-width: 220px;
  opacity: 0.55;
  transform: scale(0.85);
  transition: all 0.9s ease-in-out;
  pointer-events: auto;
}
.bc-carousel.triple .bc-carousel-slide.active {
  flex: 0 0 40%;
  max-width: 360px;
  opacity: 1;
  transform: scale(1);
  z-index: 2;
}
.bc-carousel.triple .bc-carousel-slide img {
  height: 210px;
  box-shadow: 0 16px 36px rgba(0,0,0,0.18);
}
.bc-carousel.triple .bc-carousel-nav { bottom: 0; }

@media (max-width: 900px) {
  .bc-carousel.triple { height: 240px; }
  .bc-carousel.triple .bc-carousel-slide { flex: 0 0 22%; }
  .bc-carousel.triple .bc-carousel-slide.active { flex: 0 0 46%; }
  .bc-carousel.triple .bc-carousel-slide img { height: 170px; }
}
@media (max-width: 600px) {
  .bc-carousel.triple { height: 190px; }
  .bc-carousel.triple .bc-carousel-slide { flex: 0 0 0; opacity: 0; position: absolute; }
  .bc-carousel.triple .bc-carousel-slide.active {
    position: relative;
    flex: 0 0 76%;
    opacity: 1;
    transform: scale(1);
  }
  .bc-carousel.triple .bc-carousel-slide img { height: 150px; }
}

/* Carrossel circular 3D */
.bc-carousel.circular {
  position: relative;
  perspective: 1200px;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.bc-carousel.circular .bc-carousel-slides {
  position: relative;
  width: 260px;
  height: 190px;
  transform-style: preserve-3d;
  transition: transform 1s ease-in-out;
}
.bc-carousel.circular .bc-carousel-slide {
  position: absolute;
  inset: 0;
  width: 260px;
  height: 190px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0,0,0,0.18);
  transition: transform 1s ease-in-out, opacity 1s ease-in-out, filter 1s ease-in-out;
  cursor: pointer;
  transform-origin: center center;
  backface-visibility: hidden;
}
.bc-carousel.circular .bc-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
}
.bc-carousel.circular .bc-carousel-slide.active {
  z-index: 10;
  box-shadow: 0 24px 60px rgba(13,71,161,0.35);
}
.bc-carousel.circular .bc-carousel-slide:hover {
  filter: brightness(1.05);
}
.bc-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  color: var(--azul, #1976D2);
  border: none;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transition: var(--bc-transition, all 0.25s ease);
}
.bc-carousel-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.bc-carousel-arrow.prev { left: 0; }
.bc-carousel-arrow.next { right: 0; }
.bc-carousel.circular .bc-carousel-nav {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 20;
}
.bc-carousel.circular .bc-carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--azul, #1976D2);
  background: transparent;
  cursor: pointer;
  transition: var(--bc-transition, all 0.25s ease);
}
.bc-carousel.circular .bc-carousel-dot.active { background: var(--azul, #1976D2); }

@media (max-width: 900px) {
  .bc-carousel.circular { min-height: 280px; }
  .bc-carousel.circular .bc-carousel-slides,
  .bc-carousel.circular .bc-carousel-slide { width: 220px; height: 160px; }
}
@media (max-width: 600px) {
  .bc-carousel.circular { min-height: 230px; }
  .bc-carousel.circular .bc-carousel-slides,
  .bc-carousel.circular .bc-carousel-slide { width: 180px; height: 130px; }
  .bc-carousel-arrow { width: 38px; height: 38px; font-size: 1em; }
}

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

footer {
  background: var(--bc-primary-active, #0d47a1);
  color: var(--bc-white, #ffffff);
  padding: 70px 20px 30px;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  pointer-events: none;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
  margin-bottom: 50px;
}

footer h4 {
  margin-bottom: 16px;
  font-size: 1.1em;
  font-weight: 700;
  color: var(--bc-white);
  position: relative;
  padding-bottom: 10px;
}

footer h4::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 36px;
  height: 3px;
  background: var(--bc-primary-light, #42a5f5);
  border-radius: 2px;
}

footer a {
  color: #fff;
  opacity: 0.88;
  display: block;
  margin-bottom: 10px;
  font-size: 0.95em;
  transition: opacity 0.25s ease, transform 0.25s ease;
  position: relative;
  width: fit-content;
}

footer a:hover {
  opacity: 1;
  transform: translateX(4px);
  text-decoration: underline;
}

footer a:focus-visible {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 4px;
  border-radius: 4px;
}

footer .footer-grid > div > p {
  color: #fff;
  opacity: 0.8;
  line-height: 1.7;
  font-size: 0.95em;
}

.copyright {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 24px;
  font-size: 0.9em;
  opacity: 0.85;
}

/* Redes sociais no footer */
.footer-socials {
  display: flex;
  gap: 14px;
  margin-top: 18px;
}

.footer-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  opacity: 1;
  margin: 0;
  transition: var(--bc-transition);
  transform: translateX(0);
}

.footer-socials a:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-3px) scale(1.08);
}

.footer-socials a img,
.footer-socials a svg {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

/* Responsividade footer */
@media (max-width: 768px) {
  footer { padding: 50px 20px 24px; }
  .footer-grid { gap: 30px; margin-bottom: 36px; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  footer a { width: 100%; }
}

/* Reduce motion */
@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;
  }
  .reveal,
  .fade-up,
  .fade-down,
  .fade-left,
  .fade-right,
  .zoom-in {
    opacity: 1 !important;
    transform: none !important;
  }
}
