/* ============================================================
   DPS Gestão & Tecnologia — Shared Components
   css/components.css
   ============================================================ */

/* ==================== PRELOADER ==================== */
.preloader {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: preloaderPulse 1.8s ease-in-out infinite;
}

.preloader-logo .logo-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 2rem;
  color: var(--white);
  letter-spacing: 0.04em;
}

.preloader-logo .logo-text span {
  color: var(--accent);
}

.preloader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: preloaderSpin 0.8s linear infinite;
}

@keyframes preloaderPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.96); }
}

@keyframes preloaderSpin {
  to { transform: rotate(360deg); }
}


/* ==================== NAVBAR ==================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(6, 11, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 18px 0;
  transition: all var(--transition-base);
}

.navbar.scrolled {
  background: rgba(6, 11, 26, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 0;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* Logo */
.nav-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  transition: opacity var(--transition-fast);
  flex-shrink: 0;
}

.nav-logo:hover {
  opacity: 0.85;
  color: var(--white);
}

.nav-logo .logo-accent {
  color: var(--accent);
}

.nav-logo .logo-sub {
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-left: 6px;
}

/* Nav menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 4px 0;
  transition: color var(--transition-fast);
}

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

.nav-link.active {
  color: var(--white);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width var(--transition-base);
}

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

/* Nav CTA */
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--white);
  border: 1px solid var(--accent);
  transition: all var(--transition-base);
  white-space: nowrap;
}

.nav-cta:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  box-shadow: 0 4px 18px var(--accent-glow);
  color: var(--white);
  transform: translateY(-1px);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 24px;
  cursor: pointer;
  position: relative;
  z-index: 1001;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all var(--transition-base);
  position: absolute;
}

.hamburger span:nth-child(1) { top: 2px; }
.hamburger span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.hamburger span:nth-child(3) { bottom: 2px; }

.hamburger.active span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  bottom: auto;
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
}

/* Overlay for mobile menu */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.nav-overlay.active {
  opacity: 1;
}


/* ==================== FOOTER ==================== */
.footer {
  background: var(--bg-secondary);
  padding: 60px 0 20px;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--white);
  margin-bottom: 20px;
  position: relative;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.footer-col p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.footer-col a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-links a::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.footer-links a:hover::before {
  opacity: 1;
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.footer-contact-item i {
  color: var(--accent);
  font-size: 0.9rem;
  margin-top: 3px;
  flex-shrink: 0;
}

/* Social */
.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: var(--accent-light);
  transition: all var(--transition-base);
}

.footer-social a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* Footer bottom */
.footer-bottom {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding-top: 20px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-bottom a {
  color: var(--accent-light);
}

.footer-bottom a:hover {
  color: var(--accent);
}


/* ==================== WHATSAPP FLOAT ==================== */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green-whatsapp);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
  transition: all var(--transition-base);
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
  color: var(--white);
}

.whatsapp-float::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.4);
  animation: whatsappPulse 2s ease-in-out infinite;
}

@keyframes whatsappPulse {
  0% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}


/* ==================== BACK TO TOP ==================== */
.back-to-top {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 998;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  color: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all var(--transition-base);
  text-decoration: none;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
  transform: translateY(-3px);
  box-shadow: 0 4px 16px var(--accent-glow);
}


/* ==================== PAGE BANNER ==================== */
.page-banner {
  height: 300px;
  min-height: 300px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.page-banner::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: linear-gradient(to top, var(--bg-primary), transparent);
  pointer-events: none;
}

.page-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(26, 107, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(26, 107, 255, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

.page-banner-content {
  position: relative;
  z-index: 2;
  padding: 0 var(--container-pad);
}

.page-banner-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 12px;
}

.page-banner-breadcrumb {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.page-banner-breadcrumb a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.page-banner-breadcrumb a:hover {
  color: var(--accent);
}

.page-banner-breadcrumb .separator {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.page-banner-breadcrumb .current {
  color: var(--accent-light);
}


/* ==================== CARD (shared) ==================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  transition: all var(--transition-base);
  overflow: hidden;
  scroll-margin-top: 100px;
}

.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  background: var(--bg-card-hover);
}

.card:hover::after {
  opacity: 1;
}

/* Card icon container */
.card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: rgba(26, 107, 255, 0.1);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 20px;
  transition: all var(--transition-base);
}

.card:hover .card-icon {
  background: rgba(26, 107, 255, 0.18);
  transform: scale(1.05);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
}

.card-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 16px;
  transition: all var(--transition-fast);
}

.card-link:hover {
  color: var(--accent-light);
  gap: 10px;
}


/* ==================== RESPONSIVE — COMPONENTS ==================== */

/* ≤ 1024px */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

/* ≤ 768px */
@media (max-width: 768px) {
  /* Hamburger visible */
  .hamburger {
    display: flex;
  }

  .nav-overlay {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 32px 32px;
    gap: 0;
    transform: translateX(100%);
    transition: transform var(--transition-base);
    z-index: 1000;
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
  }

  .nav-menu.active {
    transform: translateX(0);
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-link {
    display: block;
    font-size: 1rem;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    width: 100%;
  }

  .nav-link::after {
    bottom: -1px;
  }

  .nav-cta {
    margin-top: 20px;
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
  }

  /* Page Banner */
  .page-banner {
    height: auto;
    min-height: 240px;
    padding-top: 100px;
    padding-bottom: 40px;
  }

  /* Footer */
  .footer {
    padding: 48px 0 16px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-col h4::after {
    display: none;
  }

  .footer-bottom {
    margin-top: 28px;
    padding-top: 16px;
  }

  /* Card */
  .card {
    padding: 24px;
  }
}

/* ≤ 480px */
@media (max-width: 480px) {
  .nav-menu {
    width: 100%;
  }

  .nav-logo {
    font-size: 1.15rem;
  }

  .page-banner {
    min-height: 200px;
    padding-top: 90px;
    padding-bottom: 32px;
  }

  .page-banner-title {
    font-size: 1.6rem;
  }

  .whatsapp-float {
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
    bottom: 20px;
    right: 16px;
  }

  .back-to-top {
    width: 40px;
    height: 40px;
    bottom: 78px;
    right: 16px;
  }

  .card {
    padding: 20px;
    border-radius: var(--radius-md);
  }
}

/* ≤ 360px */
@media (max-width: 360px) {
  .nav-logo .logo-sub {
    display: none;
  }

  .footer-social a {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }
}
