/* ═══════════════════════════════════════════
   LICITAÇÕES ABERTAS — style.css
   Estilo institucional, limpo, governamental
═══════════════════════════════════════════ */

:root {
  --primary: #1e3a5f;
  --primary-dark: #152c48;
  --primary-light: #2d5280;
  --accent: #16a34a;
  --accent-dark: #15803d;
  --accent-light: #22c55e;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --bg-alt2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --font: 'Inter', system-ui, sans-serif;
  --max-w: 1200px;
  --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ─── LAYOUT ─── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ─── HEADER ─── */
.site-header {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: white;
  font-size: 1.1rem;
  font-weight: 500;
}

.logo strong {
  color: var(--accent-light);
  font-weight: 700;
}

.btn-cta {
  background: var(--accent);
  color: white;
  text-decoration: none;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background var(--transition);
  white-space: nowrap;
}

.btn-cta:hover { background: var(--accent-dark); }

/* ─── HERO HOMEPAGE ─── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 5rem 0 4rem;
  position: relative;
  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");
  pointer-events: none;
}

.hero-content {
  position: relative;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(22,163,74,0.2);
  border: 1px solid rgba(34,197,94,0.4);
  color: var(--accent-light);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

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

.hero-desc {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.8);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

/* ─── BUSCADOR ─── */
.search-box {
  background: white;
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  display: flex;
  gap: 0.5rem;
  max-width: 620px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  color: var(--text);
  background: transparent;
  font-family: var(--font);
}

.search-box input::placeholder { color: var(--text-light); }

.btn-search {
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background var(--transition);
  white-space: nowrap;
  font-family: var(--font);
}

.btn-search:hover { background: var(--accent-dark); }

.hero-sub {
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
  margin-top: 1rem;
}

/* ─── STATS BAR ─── */
.stats-bar {
  background: var(--primary-dark);
  border-top: 1px solid rgba(255,255,255,0.08);
}

.stats-bar-inner {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding: 1.25rem 0;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
  color: white;
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-light);
}

.stat-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── SEÇÕES ─── */
.section { padding: 4rem 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 1rem;
}

/* ─── CARDS DE CATEGORIA ─── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.category-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition);
  cursor: pointer;
}

.category-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.category-card .icon {
  font-size: 1.5rem;
}

.category-card .name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
}

.category-card .count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── ESTADOS GRID ─── */
.estados-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.estado-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all var(--transition);
}

.estado-card:hover {
  border-color: var(--primary);
  background: var(--bg-alt);
}

.estado-card .sigla {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--primary);
  width: 28px;
}

.estado-card .nome {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ─── CTA BANNER HOMEPAGE ─── */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.cta-section h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.cta-section p {
  color: rgba(255,255,255,0.8);
  margin-bottom: 2rem;
  font-size: 1.05rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.btn-primary-lg {
  display: inline-block;
  background: var(--accent);
  color: white;
  text-decoration: none;
  padding: 1rem 2rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  transition: all var(--transition);
  box-shadow: 0 4px 15px rgba(22,163,74,0.4);
}

.btn-primary-lg:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(22,163,74,0.5);
}

/* ─── PÁGINAS INTERNAS ─── */
.page-hero {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0;
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

.page-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

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

.page-desc {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.stats-row {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── CONTENT GRID ─── */
.section-content { padding: 3rem 0; }

.content-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
  align-items: start;
}

.main-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.main-content p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.7;
}

/* ─── EDITAIS ─── */
.editais-lista { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }

.edital-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  border-left: 4px solid var(--accent);
  transition: box-shadow var(--transition);
}

.edital-card:hover { box-shadow: var(--shadow); }

.edital-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.edital-badge {
  background: #dcfce7;
  color: #15803d;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
}

.edital-data { font-size: 0.8rem; color: var(--text-muted); }

.edital-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.edital-orgao { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.4rem; }

.edital-valor { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.btn-edital {
  display: inline-block;
  background: var(--primary);
  color: white;
  text-decoration: none;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  transition: background var(--transition);
}

.btn-edital:hover { background: var(--primary-light); }

.sem-dados {
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

/* ─── TABELA VENCEDORES ─── */
.tabela-vencedores {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-top: 1rem;
}

.tabela-vencedores th {
  background: var(--bg-alt2);
  color: var(--primary);
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border);
}

.tabela-vencedores td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.tabela-vencedores tr:hover td { background: var(--bg-alt); }

/* ─── SIDEBAR ─── */
.sidebar { display: flex; flex-direction: column; gap: 1.25rem; }

.cta-box {
  background: var(--primary);
  color: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.cta-box h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; }

.cta-box p { font-size: 0.875rem; color: rgba(255,255,255,0.75); margin-bottom: 1.25rem; line-height: 1.5; }

.btn-primary {
  display: block;
  background: var(--accent);
  color: white;
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  text-align: center;
  transition: background var(--transition);
}

.btn-primary:hover { background: var(--accent-dark); }

.categorias-box {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.categorias-box h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.categorias-box ul { list-style: none; }

.categorias-box li { border-bottom: 1px solid var(--border); }
.categorias-box li:last-child { border-bottom: none; }

.categorias-box a {
  display: block;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.categorias-box a:hover { color: var(--accent); }

/* ─── CTA BANNER INTERNO ─── */
.cta-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 3.5rem 0;
  text-align: center;
  margin-top: 2rem;
}

.cta-banner h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.75rem; }
.cta-banner p { color: rgba(255,255,255,0.8); margin-bottom: 1.75rem; font-size: 0.95rem; max-width: 520px; margin-left: auto; margin-right: auto; }

/* ─── FOOTER ─── */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  padding: 3rem 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}

.footer-links {
  list-style: none;
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-links a {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color var(--transition);
}

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

.footer-grid strong {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
}

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

/* ─── RESPONSIVO ─── */
@media (max-width: 768px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .sidebar { order: -1; }

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

  .stats-bar-inner { gap: 1.5rem; }

  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

  .search-box {
    flex-direction: column;
  }

  .search-box input { padding: 0.875rem 1rem; }

  .stats-row { gap: 1.5rem; }
}
