/* ========================================
   CidadãoAI — Design System & Landing Page
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
  --bg-primary: #080b14;
  --bg-secondary: #0d1321;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(99,230,190,0.3);

  --teal: #3ecfb2;
  --teal-light: #6eebd4;
  --teal-glow: rgba(62,207,178,0.15);
  --purple: #7c3aed;
  --purple-light: #a78bfa;
  --purple-glow: rgba(124,58,237,0.2);
  --gold: #f59e0b;

  --text-primary: #f0f4ff;
  --text-secondary: #8b9ab5;
  --text-muted: #4a5568;

  --gradient-hero: linear-gradient(135deg, #080b14 0%, #0f1829 40%, #130a2a 100%);
  --gradient-teal: linear-gradient(135deg, #3ecfb2, #1a9e87);
  --gradient-purple: linear-gradient(135deg, #7c3aed, #a855f7);
  --gradient-card: linear-gradient(135deg, rgba(62,207,178,0.05), rgba(124,58,237,0.05));

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  --shadow-teal: 0 0 40px rgba(62,207,178,0.15);
  --shadow-purple: 0 0 40px rgba(124,58,237,0.2);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.5);

  --font-main: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Light Mode Variables ── */
.light-mode {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(0, 0, 0, 0.03);
  --bg-card-hover: rgba(0, 0, 0, 0.06);
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(62, 207, 178, 0.5);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --gradient-hero: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 40%, #f1f5f9 100%);
  --shadow-card: 0 8px 32px rgba(31, 38, 135, 0.1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--teal); border-radius: 3px; }

/* ── Noise Texture Overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ── Orbs / Glow Background ── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 8s ease-in-out infinite;
}
.orb-1 { width: 500px; height: 500px; background: var(--purple-glow); top: -200px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: var(--teal-glow); bottom: -100px; right: -100px; animation-delay: 4s; }
.orb-3 { width: 300px; height: 300px; background: rgba(245,158,11,0.08); top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: 2s; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -20px) scale(1.05); }
}

/* ── Utility ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.section { padding: 100px 0; }
.section-alt { background: var(--bg-secondary); }
.gradient-text {
  background: linear-gradient(135deg, var(--teal-light), var(--purple-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

/* ── NAVBAR ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: var(--transition);
}
.navbar.scrolled {
  background: rgba(8,11,20,0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
}
.logo-icon {
  width: 40px; height: 40px;
  background: var(--gradient-teal);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-teal);
}
.logo-icon.logo-clean {
  background: none;
  box-shadow: none;
  padding: 0;
}
.logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
}
.logo-img-sm {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 6px;
}
.logo span { color: var(--teal); }

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}
.nav-links a:hover { color: var(--text-primary); }

.nav-cta {
  display: flex;
  gap: 12px;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: var(--font-main);
}
.btn-primary {
  background: var(--gradient-teal);
  color: #080b14;
  box-shadow: 0 4px 20px rgba(62,207,178,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(62,207,178,0.4);
}
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-glow);
}
.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-1px);
}
.theme-toggle-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.theme-toggle-btn .theme-icon {
  font-size: 1.2rem;
}
.btn-purple {
  background: var(--gradient-purple);
  color: white;
  box-shadow: 0 4px 20px rgba(124,58,237,0.3);
}
.btn-purple:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(124,58,237,0.4);
}
.btn-lg { padding: 16px 36px; font-size: 1rem; }

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.hero-content { position: relative; z-index: 2; }
.hero-eyebrow { margin-bottom: 20px; }
.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}
.hero-desc {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 480px;
}
.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}
.hero-stats {
  display: flex;
  gap: 40px;
}
.stat-item { text-align: center; }
.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-visual {
  position: relative;
  z-index: 2;
}
.hero-image-wrapper {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card), var(--shadow-teal);
  animation: heroFloat 6s ease-in-out infinite;
}
@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.hero-image-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, var(--bg-primary));
  z-index: 1;
}
.hero-image-wrapper img { width: 100%; display: block; }
.floating-card {
  position: absolute;
  padding: 14px 20px;
  background: rgba(13,19,33,0.9);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  z-index: 2;
}
.floating-card-1 { bottom: 30px; left: -30px; }
.floating-card-2 { top: 40px; right: -20px; }
.fc-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.fc-value { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.fc-value .highlight { color: var(--teal); }
.fc-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.fc-bar-fill {
  height: 100%;
  background: var(--gradient-teal);
  border-radius: 2px;
  animation: barFill 2s ease 1s both;
}
@keyframes barFill { from { width: 0; } to { width: var(--w); } }
.fc-ai-icon {
  width: 36px; height: 36px;
  background: var(--gradient-purple);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; margin-bottom: 8px;
  box-shadow: var(--shadow-purple);
}

/* ── FEATURES ── */
.section-header { text-align: center; margin-bottom: 64px; }
.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 16px;
}
.section-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature-card {
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  opacity: 0;
  transition: var(--transition);
}
.feature-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card), var(--shadow-teal);
}
.feature-card:hover::before { opacity: 1; }
.feature-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}
.fi-teal { background: linear-gradient(135deg, rgba(62,207,178,0.2), rgba(62,207,178,0.05)); border: 1px solid rgba(62,207,178,0.2); }
.fi-purple { background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(124,58,237,0.05)); border: 1px solid rgba(124,58,237,0.2); }
.fi-gold { background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(245,158,11,0.05)); border: 1px solid rgba(245,158,11,0.2); }
.feature-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  position: relative; z-index: 1;
}
.feature-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  position: relative; z-index: 1;
}

/* ── HOW IT WORKS ── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
}
.steps-grid::before {
  content: '';
  position: absolute;
  top: 40px;
  left: 80px;
  right: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--teal), var(--purple), transparent);
  opacity: 0.3;
}
.step-card {
  text-align: center;
  padding: 32px 20px;
  position: relative;
}
.step-number {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--gradient-teal);
  color: var(--bg-primary);
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 0 30px rgba(62,207,178,0.3);
}
.step-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.step-desc { color: var(--text-secondary); font-size: 0.85rem; line-height: 1.6; }

/* ── IMPACT ── */
.impact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.impact-title { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; margin-bottom: 20px; line-height: 1.2; }
.impact-desc { color: var(--text-secondary); line-height: 1.8; margin-bottom: 32px; }
.impact-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.impact-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.impact-check {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--teal-glow);
  border: 1px solid rgba(62,207,178,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  color: var(--teal);
  flex-shrink: 0;
  margin-top: 2px;
}
.impact-item-text { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; }
.impact-item-text strong { color: var(--text-primary); }

.impact-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.impact-stat-card {
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--gradient-card);
  text-align: center;
  transition: var(--transition);
}
.impact-stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
}
.isn-number {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 8px;
  display: block;
}
.isn-label { color: var(--text-secondary); font-size: 0.85rem; }

/* ── CHATBOT DEMO ── */
.demo-wrapper {
  max-width: 800px;
  margin: 0 auto;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(13,19,33,0.8);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card), var(--shadow-purple);
}
.demo-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.demo-dots { display: flex; gap: 8px; }
.demo-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--border);
}
.demo-dot:first-child { background: #ff5f57; }
.demo-dot:nth-child(2) { background: #febc2e; }
.demo-dot:last-child { background: #28c840; }
.demo-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-left: auto;
  font-weight: 500;
}
.demo-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--teal);
  font-weight: 600;
}
.demo-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal);
  animation: pulse 2s infinite;
}
.demo-chat { padding: 32px 24px; min-height: 300px; display: flex; flex-direction: column; gap: 20px; }
.chat-msg {
  display: flex;
  gap: 14px;
  max-width: 80%;
  animation: msgIn 0.3s ease;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
}
.chat-avatar.ai { background: var(--gradient-teal); color: var(--bg-primary); }
.chat-avatar.user { background: var(--gradient-purple); color: white; }
.chat-bubble {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.6;
}
.ai .chat-bubble { background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--text-primary); border-top-left-radius: 4px; }
.user .chat-bubble { background: var(--gradient-teal); color: var(--bg-primary); font-weight: 500; border-top-right-radius: 4px; }
.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(62,207,178,0.3);
  color: var(--teal);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}
.chip:hover { background: var(--teal-glow); transform: translateY(-1px); }

/* ── TECH ── */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.tech-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-align: center;
  transition: var(--transition);
}
.tech-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
}
.tech-emoji { font-size: 2rem; margin-bottom: 12px; display: block; }
.tech-name { font-weight: 700; margin-bottom: 6px; }
.tech-desc { font-size: 0.8rem; color: var(--text-secondary); }

/* ── CTA / FOOTER ── */
.cta-section {
  text-align: center;
  padding: 120px 0;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.cta-title { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 900; margin-bottom: 20px; letter-spacing: -0.02em; }
.cta-desc { color: var(--text-secondary); font-size: 1.1rem; margin-bottom: 40px; max-width: 500px; margin-left: auto; margin-right: auto; }
.cta-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-copy { color: var(--text-muted); font-size: 0.85rem; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; transition: var(--transition); }
.footer-links a:hover { color: var(--teal); }

/* ── ANIMATIONS ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .steps-grid { grid-template-columns: 1fr 1fr; }
  .impact-grid { grid-template-columns: 1fr; }
  .tech-grid { grid-template-columns: 1fr 1fr; }
  .hero-visual { order: -1; }
  .steps-grid::before { display: none; }
  .nav-links { display: none; }
}
@media (max-width: 600px) {
  .features-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .impact-stats-grid { grid-template-columns: 1fr; }
  .tech-grid { grid-template-columns: 1fr 1fr; }
  .hero-stats { gap: 24px; }
  .floating-card-1, .floating-card-2 { display: none; }
}
