/* ============================================
   CFTV Niterói - Modern Security Website CSS
   Optimized for performance & mobile-first
   ============================================ */

:root {
  --primary: #0d47a1;
  --primary-dark: #002171;
  --primary-light: #5472d3;
  --accent: #00c853;
  --accent-hover: #00a844;
  --dark: #0a192f;
  --dark-light: #112240;
  --gray: #64748b;
  --light: #f8fafc;
  --white: #ffffff;
  --shadow: 0 10px 40px rgba(0,0,0,0.08);
  --shadow-lg: 0 25px 50px rgba(0,0,0,0.12);
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #1e293b;
  background: var(--white);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== TOP BAR ========== */
.topbar {
  background: var(--dark);
  color: var(--white);
  padding: 10px 0;
  font-size: 0.875rem;
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-contact {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.topbar-contact a {
  color: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-contact a:hover {
  color: var(--accent);
}

.topbar-social {
  display: flex;
  gap: 12px;
}

.topbar-social a {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.topbar-social a:hover {
  background: var(--accent);
}

/* ========== HEADER ========== */
.header {
  background: var(--white);
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}

.header.scrolled {
  box-shadow: 0 4px 30px rgba(0,0,0,0.1);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--primary);
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.logo span {
  color: var(--dark);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav a {
  padding: 8px 16px;
  font-weight: 500;
  color: var(--dark);
  border-radius: 8px;
  font-size: 0.95rem;
}

.nav a:hover,
.nav a.active {
  color: var(--primary);
  background: rgba(13, 71, 161, 0.08);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 15px rgba(13, 71, 161, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(13, 71, 161, 0.45);
}

.btn-accent {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 200, 83, 0.35);
}

.btn-accent:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-whatsapp {
  background: #25D366;
  color: white;
}

.btn-whatsapp:hover {
  background: #1da851;
  transform: translateY(-2px);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--dark);
  cursor: pointer;
}

/* ========== HERO ========== */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #0a192f 0%, #0d47a1 50%, #1565c0 100%);
  color: white;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.875rem;
  margin-bottom: 24px;
  border: 1px solid rgba(255,255,255,0.15);
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero h1 span {
  color: var(--accent);
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: 32px;
  max-width: 560px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 48px;
}

.hero-stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: left;
}

.stat-item strong {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-item span {
  font-size: 0.875rem;
  opacity: 0.8;
}

/* ========== SECTIONS COMMON ========== */
section {
  padding: 80px 0;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 56px;
}

.section-header .subtitle {
  display: inline-block;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 16px;
  line-height: 1.25;
}

.section-header p {
  color: var(--gray);
  font-size: 1.05rem;
}

/* ========== SERVICES ========== */
.services {
  background: var(--light);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}

.service-card {
  background: white;
  border-radius: var(--radius);
  padding: 36px 28px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  transform: scaleY(0);
  transition: var(--transition);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(13, 71, 161, 0.1);
}

.service-card:hover::before {
  transform: scaleY(1);
}

.service-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(13,71,161,0.1), rgba(84,114,211,0.15));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.service-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--dark);
}

.service-card p {
  color: var(--gray);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.service-card .read-more {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.service-card .read-more:hover {
  gap: 10px;
}

/* ========== ABOUT ========== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-content h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.3rem);
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 20px;
  line-height: 1.25;
}

.about-content p {
  color: var(--gray);
  margin-bottom: 16px;
}

.about-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.feature-item i {
  color: var(--accent);
  font-size: 1.25rem;
  margin-top: 2px;
}

.feature-item span {
  font-weight: 500;
  font-size: 0.95rem;
}

.about-image {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-image-content {
  text-align: center;
  color: white;
  padding: 40px;
}

.about-image-content i {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.9;
}

.about-image-content h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

/* ========== WHY US ========== */
.why-us {
  background: var(--dark);
  color: white;
}

.why-us .section-header .subtitle {
  color: var(--accent);
}

.why-us .section-header h2,
.why-us .section-header p {
  color: white;
}

.why-us .section-header p {
  opacity: 0.8;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}

.why-card {
  background: var(--dark-light);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.06);
  transition: var(--transition);
}

.why-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 200, 83, 0.3);
}

.why-card i {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 16px;
}

.why-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.why-card p {
  font-size: 0.9rem;
  opacity: 0.75;
}

/* ========== PROCESS ========== */
.process-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  counter-reset: step;
}

.process-step {
  text-align: center;
  position: relative;
  padding: 24px 16px;
}

.process-step::before {
  counter-increment: step;
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  font-weight: 800;
  font-size: 1.25rem;
  border-radius: 50%;
  margin: 0 auto 20px;
}

.process-step h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--dark);
}

.process-step p {
  font-size: 0.9rem;
  color: var(--gray);
}

/* ========== FAQ ========== */
.faq {
  background: var(--light);
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: white;
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 20px 24px;
  background: none;
  border: none;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq-question i {
  transition: var(--transition);
  color: var(--primary);
}

.faq-item.active .faq-question i {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.faq-answer-inner {
  padding: 0 24px 20px;
  color: var(--gray);
  font-size: 0.95rem;
}

.faq-item.active .faq-answer {
  max-height: 300px;
}

/* ========== CONTACT ========== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
}

.contact-info h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--dark);
}

.contact-info > p {
  color: var(--gray);
  margin-bottom: 32px;
}

.contact-item {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.contact-item-icon {
  width: 48px;
  height: 48px;
  background: rgba(13, 71, 161, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.contact-item h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--dark);
}

.contact-item p,
.contact-item a {
  color: var(--gray);
  font-size: 0.95rem;
}

.contact-item a:hover {
  color: var(--primary);
}

.contact-form {
  background: white;
  padding: 36px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--dark);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--light);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(13, 71, 161, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ========== FOOTER ========== */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,0.8);
  padding-top: 64px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand .logo {
  color: white;
  margin-bottom: 16px;
}

.footer-brand p {
  font-size: 0.9rem;
  margin-bottom: 20px;
  opacity: 0.75;
}

.footer h4 {
  color: white;
  font-size: 1.05rem;
  margin-bottom: 20px;
  font-weight: 700;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  font-size: 0.9rem;
  opacity: 0.75;
}

.footer-links a:hover {
  opacity: 1;
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.875rem;
}

/* ========== FLOATING WHATSAPP ========== */
.whatsapp-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.8rem;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
  z-index: 999;
  transition: var(--transition);
  animation: pulse 2s infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  background: #1da851;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 992px) {
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

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

  .about-image {
    min-height: 300px;
    order: -1;
  }
}

@media (max-width: 768px) {
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    gap: 4px;
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    width: 100%;
    padding: 12px 16px;
  }

  .mobile-toggle {
    display: block;
  }

  .hero {
    min-height: auto;
    padding: 80px 0 60px;
  }

  .hero-stats {
    gap: 24px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

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

  section {
    padding: 60px 0;
  }
}

/* Utility */
.text-center { text-align: center; }
.mt-4 { margin-top: 1.5rem; }
