/*
 * Política de Dados Abertos — Design System
 * Clean, organized, professional layout
 */

/* ═══════════════════════════════════════════
   1. DESIGN TOKENS
   ═══════════════════════════════════════════ */

:root {
  /* Palette */
  --c-bg: #0b1120;
  --c-surface: #131b2e;
  --c-surface-2: #1a2440;
  --c-primary: #3b82f6;
  --c-accent: #6366f1;
  --c-teal: #14b8a6;
  --c-text: #e2e8f0;
  --c-muted: #8896ab;
  --c-border: rgba(99, 102, 241, 0.12);
  --c-glow: rgba(59, 130, 246, 0.25);

  --gradient: linear-gradient(135deg, var(--c-primary), var(--c-accent));

  /* Type Scale (fluid) */
  --fs-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --fs-sm: clamp(0.85rem, 0.8rem + 0.25vw, 0.9375rem);
  --fs-base: clamp(0.95rem, 0.88rem + 0.35vw, 1.0625rem);
  --fs-lg: clamp(1.1rem, 1rem + 0.5vw, 1.25rem);
  --fs-xl: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
  --fs-2xl: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
  --fs-hero: clamp(2.25rem, 1.5rem + 3.5vw, 4rem);

  /* Spacing */
  --container: min(90%, 1140px);
  --section-y: clamp(3rem, 2rem + 4vw, 6rem);
  --gap: 1.5rem;

  /* Radius */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, .35);
  --shadow-glow: 0 0 24px var(--c-glow);

  /* Transitions */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --bounce: cubic-bezier(.18, .89, .32, 1.28);
}

/* ═══════════════════════════════════════════
   2. RESET & BASE
   ═══════════════════════════════════════════ */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: var(--fs-base);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* ═══════════════════════════════════════════
   3. LAYOUT UTILITIES
   ═══════════════════════════════════════════ */

.container {
  width: var(--container);
  margin-inline: auto;
}

/* ═══════════════════════════════════════════
   4. NAVIGATION
   ═══════════════════════════════════════════ */

.navbar {
  position: fixed;
  inset-inline: 0;
  top: 0;
  background: rgba(11, 17, 32, .82);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid var(--c-border);
  z-index: 1000;
  transition: background .3s var(--ease);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 0;
}

/* Logo */
.logo {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.02em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Nav Links */
.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .25rem;
}

.nav-links a {
  display: block;
  padding: .45rem .85rem;
  border-radius: var(--r-sm);
  color: var(--c-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: all .25s var(--ease);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--c-text);
  background: rgba(99, 102, 241, .1);
}

/* Hamburger */
.menu-toggle {
  display: none;
  font-size: 1.4rem;
  color: var(--c-text);
  cursor: pointer;
  background: none;
  border: none;
  padding: .4rem;
  border-radius: var(--r-sm);
  transition: background .2s;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, .06);
}

/* ═══════════════════════════════════════════
   5. HERO
   ═══════════════════════════════════════════ */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 6rem 1rem 4rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, rgba(59, 130, 246, .12), transparent),
    radial-gradient(ellipse 50% 60% at 80% 20%, rgba(99, 102, 241, .1), transparent);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, var(--c-bg));
  z-index: 1;
}

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

.hero h1 {
  font-size: var(--fs-hero);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  color: #fff;
}

.hero p {
  font-size: var(--fs-lg);
  color: var(--c-muted);
  margin-bottom: 2.5rem;
  max-width: 56ch;
  margin-inline: auto;
  line-height: 1.65;
}

/* ═══════════════════════════════════════════
   6. BUTTONS
   ═══════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 2.2rem;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: .02em;
  transition: all .35s var(--bounce);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-md), 0 0 0 0 var(--c-glow);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-primary:active {
  transform: translateY(0) scale(.97);
}

/* ═══════════════════════════════════════════
   7. SECTIONS
   ═══════════════════════════════════════════ */

.section {
  padding: var(--section-y) 0;
  position: relative;
}

.alt-bg {
  background: var(--c-surface);
}

/* Section headings */
.section h2 {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.section h2::before {
  content: '';
  width: 4px;
  height: 1.1em;
  border-radius: 4px;
  background: var(--gradient);
  flex-shrink: 0;
}

.section>.container>p {
  color: var(--c-muted);
  font-size: var(--fs-base);
  max-width: 78ch;
  margin-bottom: 1.75rem;
  line-height: 1.75;
}

.footer-note {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--c-border);
  font-size: var(--fs-xs);
  color: var(--c-muted);
  text-align: center;
}

/* ═══════════════════════════════════════════
   8. CARD GRID SYSTEM
   ═══════════════════════════════════════════ */

.card-grid {
  display: grid;
  gap: var(--gap);
  margin-top: 2rem;
}

.card-grid.two-cols {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.card-grid.three-cols {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.card-grid.four-cols {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

/* ═══════════════════════════════════════════
   9. CARDS
   ═══════════════════════════════════════════ */

.card {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, .3);
}

.card h3 {
  font-size: var(--fs-xl);
  font-weight: 600;
  color: #fff;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.card h3::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-primary);
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--c-glow);
}

.card p,
.card ul {
  color: var(--c-muted);
  font-size: var(--fs-sm);
  line-height: 1.7;
}

.card ul {
  list-style: none;
  margin-top: .5rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.card ul li {
  padding-left: 1.6rem;
  position: relative;
}

.card ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-teal);
  box-shadow: 0 0 6px rgba(20, 184, 166, .4);
}

/* ═══════════════════════════════════════════
   10. ICON GRID (Concept Section)
   ═══════════════════════════════════════════ */

.icon-grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  margin-top: 2rem;
}

.icon-card {
  text-align: center;
  background: var(--c-surface-2);
  padding: 2rem 1.25rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s;
}

.icon-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, .3);
  box-shadow: var(--shadow-md);
}

.icon-card i {
  font-size: 2.5rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
  margin-bottom: .75rem;
  transition: transform .3s var(--ease);
}

.icon-card:hover i {
  transform: scale(1.1);
}

.icon-card h3 {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: .35rem;
}

.icon-card p {
  font-size: var(--fs-xs);
  color: var(--c-muted);
  line-height: 1.55;
}

/* ═══════════════════════════════════════════
   11. CHECKLIST (Challenges Section)
   ═══════════════════════════════════════════ */

.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.checklist li {
  padding: 1rem 1.25rem;
  background: var(--c-surface-2);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  transition: border-color .3s, transform .3s var(--ease);
  font-size: var(--fs-sm);
  color: var(--c-muted);
  line-height: 1.65;
}

.checklist li:hover {
  border-color: rgba(99, 102, 241, .25);
  transform: translateX(4px);
}

.checklist li::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  margin-top: .45rem;
  border-radius: 50%;
  background: var(--c-accent);
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(99, 102, 241, .4);
}

.checklist li strong {
  color: var(--c-text);
}

/* ═══════════════════════════════════════════
   12. BACK TO TOP (bottom-left)
   ═══════════════════════════════════════════ */

#backToTop {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: none;
  background: var(--gradient);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(.85);
  transition: all .4s var(--bounce);
  z-index: 900;
  box-shadow: var(--shadow-md);
}

#backToTop.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

#backToTop:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow: var(--shadow-glow);
}

/* ═══════════════════════════════════════════
   13. AI CHAT WIDGET
   ═══════════════════════════════════════════ */

/* Toggle Button (bottom-right) */
#chatToggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  background: var(--gradient);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 1010;
  box-shadow: var(--shadow-lg), 0 0 20px var(--c-glow);
  transition: all .35s var(--bounce);
}

#chatToggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg), 0 0 32px var(--c-glow);
}

#chatToggle.active {
  background: var(--c-surface-2);
  box-shadow: var(--shadow-md);
}

/* Chat Window */
.chat-widget {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  width: 340px;
  max-width: calc(100vw - 2rem);
  height: 440px;
  max-height: calc(100vh - 8rem);
  border-radius: var(--r-lg);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 0, 0, .4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1005;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(.95);
  transform-origin: bottom right;
  transition: all .35s var(--bounce);
}

.chat-widget.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1rem;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.chat-avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--gradient);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}

.chat-title {
  display: block;
  font-weight: 600;
  font-size: var(--fs-sm);
  color: #fff;
  line-height: 1.2;
}

.chat-subtitle {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-muted);
  line-height: 1.2;
}

.chat-close {
  background: none;
  border: none;
  color: var(--c-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: .25rem;
  border-radius: var(--r-sm);
  transition: all .2s;
  display: grid;
  place-items: center;
}

.chat-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, .08);
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--c-surface-2) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 5px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--c-surface-2);
  border-radius: 10px;
}

/* Welcome */
.chat-welcome {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--c-muted);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.chat-welcome-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto .75rem;
  border-radius: 50%;
  background: rgba(99, 102, 241, .1);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  color: var(--c-accent);
}

.chat-welcome strong {
  color: var(--c-text);
}

/* Message Bubbles */
.chat-msg {
  max-width: 85%;
  padding: .7rem 1rem;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  line-height: 1.6;
  word-break: break-word;
  animation: msgIn .3s var(--ease);
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--gradient);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg.ai {
  align-self: flex-start;
  background: var(--c-surface-2);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-bottom-left-radius: 4px;
}

/* Typing indicator */
.chat-typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: .7rem 1rem;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  border-bottom-left-radius: 4px;
}

.chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-muted);
  animation: typingDot 1.4s infinite ease-in-out both;
}

.chat-typing span:nth-child(2) {
  animation-delay: .16s;
}

.chat-typing span:nth-child(3) {
  animation-delay: .32s;
}

@keyframes typingDot {

  0%,
  80%,
  100% {
    transform: scale(.4);
    opacity: .4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Input Area */
.chat-input-area {
  display: flex;
  gap: .5rem;
  padding: .75rem;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
  flex-shrink: 0;
}

#chatInput {
  flex: 1;
  padding: .6rem .9rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-border);
  background: var(--c-bg);
  color: var(--c-text);
  font-family: inherit;
  font-size: var(--fs-sm);
  outline: none;
  transition: border-color .25s;
}

#chatInput::placeholder {
  color: var(--c-muted);
}

#chatInput:focus {
  border-color: var(--c-accent);
}

#chatSend {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: none;
  background: var(--gradient);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all .25s var(--ease);
}

#chatSend:hover {
  transform: scale(1.08);
  box-shadow: 0 0 12px var(--c-glow);
}

#chatSend:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

/* Error message */
.chat-error {
  align-self: center;
  font-size: var(--fs-xs);
  color: #f87171;
  background: rgba(248, 113, 113, .08);
  padding: .4rem .8rem;
  border-radius: var(--r-sm);
  border: 1px solid rgba(248, 113, 113, .15);
}


/* ═══════════════════════════════════════════
   14. RESPONSIVE — MOBILE
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    flex-direction: column;
    background: rgba(11, 17, 32, .96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: .75rem 1rem 1rem;
    gap: .35rem;
    border-bottom: 1px solid var(--c-border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all .3s var(--ease);
  }

  .nav-links.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-links a {
    padding: .75rem 1rem;
    border-radius: var(--r-sm);
    font-size: var(--fs-base);
  }

  .nav-links a:active {
    background: rgba(99, 102, 241, .15);
  }

  .hero {
    padding: 5rem 1rem 3rem;
  }
}

/* Very small screens */
@media (max-width: 380px) {
  :root {
    --container: 94%;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

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