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

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

:root {
  --black: #000000;
  --dark: #111111;
  --gray-dark: #333333;
  --gray-mid: #555555;
  --gray-light: #e2e8f0;
  --bg-soft: #f8fafc;
  --white: #ffffff;
  --accent-blue: #2563eb;
  --accent-blue-light: #dbeafe;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
}

/* === HEADER NORMAL (NÃO FIXO) === */
header {
  background: var(--black);
  color: var(--white);
  padding: 16px 0;
  position: relative;
  z-index: 10;
  border-bottom: 4px solid var(--accent-blue);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.02em;
}

.logo-mark {
  background: var(--accent-blue);
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 4px;
  line-height: 1;
}

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

.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-links a {
  color: var(--white);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 10px 16px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #222222;
  border: 2px solid #444444;
  transition: background 0.1s, color 0.1s;
}

.nav-links a:hover { background: var(--accent-blue); color: var(--white); border-color: var(--black); }

/* === HERO CENTRALIZADO === */
.hero-section {
  padding: 36px 0 28px;
  text-align: center;
  border-bottom: 3px solid var(--black);
  margin-bottom: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--black);
  color: var(--white);
  padding: 6px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  text-align: center;
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--black);
  margin-bottom: 14px;
  text-align: center;
}

.hero-subtitle {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--gray-dark);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.55;
  text-align: center;
}

/* === STATS CENTRALIZADOS E ALINHADOS === */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 36px;
  width: 100%;
  box-sizing: border-box;
}

.stat-box {
  background: var(--bg-soft);
  border: 3px solid var(--black);
  padding: 22px 16px;
  text-align: center;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.stat-num {
  font-size: 3rem;
  font-weight: 900;
  color: var(--black);
  line-height: 1;
  margin-bottom: 6px;
  text-align: center;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--gray-dark);
  text-align: center;
}

/* === ABAS PERFEITAMENTE ALINHADAS (GRID 50/50) === */
.tab-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 36px;
  width: 100%;
  box-sizing: border-box;
}

.tab-btn {
  width: 100%;
  max-width: 100%;
  background: var(--white);
  border: 3px solid var(--black);
  padding: 14px 20px;
  min-height: 54px;
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--black);
  cursor: pointer;
  border-radius: 8px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition: background 0.1s ease, color 0.1s ease;
}

.tab-btn:hover { background: var(--gray-light); }
.tab-btn.active { background: var(--black); color: var(--white); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* === TÍTULO DE SEÇÃO CENTRALIZADO LIMPO === */
.section-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--black);
  margin: 0 auto 28px;
  text-align: center;
  width: 100%;
  display: block;
}

/* === GRID DE MESES ALINHADO SEM ESTOURO === */
.grid-months {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 48px;
  width: 100%;
  box-sizing: border-box;
}

.month-card {
  background: var(--white);
  border: 3px solid var(--black);
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  color: var(--black);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 190px;
  width: 100%;
  box-sizing: border-box;
  transition: background 0.1s;
}

.month-card:hover {
  background: var(--bg-soft);
  border-color: var(--black);
}

.month-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--black);
}

.month-card-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--black);
}

.month-card-badge {
  background: var(--black);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 4px;
}

.month-card-badge.has-holiday {
  background: var(--accent-blue);
  color: var(--white);
  border: 1px solid var(--black);
}

.month-card-list {
  list-style: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 14px;
}

.month-card-list li {
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.month-card-btn {
  background: var(--black);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 900;
  text-align: center;
  padding: 12px;
  min-height: 48px;
  border-radius: 6px;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.month-card:hover .month-card-btn {
  background: var(--accent-blue);
  color: var(--white);
}

/* === TABELAS RESPONSIVAS E CENTRALIZADAS === */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 3px solid var(--black);
  border-radius: 8px;
  margin-bottom: 40px;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  background: var(--white);
}

th {
  background: var(--black);
  color: var(--white);
  padding: 14px 18px;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 3px solid var(--black);
  white-space: nowrap;
}

td {
  padding: 14px 18px;
  border-bottom: 2px solid var(--gray-light);
  color: var(--black);
  font-weight: 600;
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: var(--bg-soft); }

/* === BADGES DE ALTO CONTRASSTE === */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  border: 2px solid var(--black);
  white-space: nowrap;
}

.badge-nacional    { background: #dbeafe; color: #1e3a8a; border-color: #2563eb; }
.badge-facultativo { background: #e0f2fe; color: #0369a1; border-color: #0284c7; }
.badge-estadual    { background: #e0e7ff; color: #3730a3; border-color: #4f46e5; }
.badge-comemorativa{ background: #e2e8f0; color: #000000; border-color: #000000; }

/* === ARTIGOS & DETALHES CENTRALIZADOS === */
.article-content {
  max-width: 850px;
  margin: 0 auto;
  padding-bottom: 60px;
}

.article-content h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 900;
  color: var(--black);
  margin-bottom: 20px;
  line-height: 1.2;
  text-align: center;
}

.article-content h2 {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--black);
  margin-top: 40px;
  margin-bottom: 16px;
  text-align: center;
  border-bottom: 3px solid var(--black);
  padding-bottom: 8px;
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.article-content h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--black);
  margin-top: 24px;
  margin-bottom: 10px;
}

.article-content p {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.7;
  color: var(--dark);
  margin-bottom: 20px;
}

.article-content ul, .article-content ol {
  padding-left: 24px;
  margin-bottom: 24px;
  color: var(--dark);
  font-weight: 600;
}

.article-content li {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

/* === FAQ CENTRALIZADO === */
.faq-item {
  border: 3px solid var(--black);
  border-radius: 8px;
  margin-bottom: 14px;
  background: var(--white);
  overflow: hidden;
}

.faq-question {
  padding: 18px 20px;
  min-height: 52px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--black);
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-soft);
}

.faq-question::after {
  content: '+';
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--black);
  margin-left: 12px;
}

.faq-item[open] > .faq-question::after { content: '−'; }

.faq-answer {
  padding: 20px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.65;
  border-top: 3px solid var(--black);
}

/* === CALCULADORA CENTRALIZADA === */
.calc-card {
  max-width: 680px;
  margin: 0 auto;
  border: 3px solid var(--black);
  border-radius: 10px;
  padding: 32px 24px;
  background: var(--white);
  box-shadow: 6px 6px 0px var(--black);
}

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

.form-group label {
  display: block;
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--black);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  background: var(--white);
  border: 3px solid var(--black);
  border-radius: 6px;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--black);
}

.form-control:focus {
  outline: none;
  background: #eff6ff;
}

.form-check { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.form-check input { width: 24px; height: 24px; cursor: pointer; accent-color: var(--black); }
.form-check label { font-size: 1.05rem; font-weight: 800; color: var(--black); cursor: pointer; }

.btn-primary {
  width: 100%;
  height: 56px;
  background: var(--black);
  border: none;
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font);
  font-size: 1.15rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}

.btn-primary:hover { background: #333333; }

.results-box {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 3px solid var(--black);
  display: none;
  flex-direction: column;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 2px solid var(--gray-light);
}

.result-item:last-child { border-bottom: none; }
.result-label { font-size: 1.05rem; font-weight: 800; color: var(--dark); }
.result-value { font-size: 1.6rem; font-weight: 900; color: var(--black); }
.result-value.big { font-size: 2.4rem; color: var(--black); }

/* === FOOTER CENTRALIZADO === */
.footer-section {
  background: var(--black);
  color: var(--white);
  padding: 36px 0;
  margin-top: 64px;
  border-top: 4px solid var(--accent-blue);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}

.footer-brand { font-size: 1.2rem; font-weight: 900; color: var(--white); }
.footer-brand span { color: var(--accent-blue); }
.footer-copy { font-size: 0.95rem; font-weight: 600; color: #cccccc; margin-bottom: 0; }
.footer-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.footer-links a { font-size: 0.95rem; font-weight: 800; color: var(--white); text-decoration: underline; }
.footer-links a:hover { color: var(--accent-blue); }

/* === WIDGET DE CALENDÁRIO VISUAL COMPLETO COM TODOS OS NÚMEROS === */
.month-calendar-widget {
  background: var(--white);
  border: 3px solid var(--black);
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  width: 100%;
  box-sizing: border-box;
}

.calendar-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--white);
  background: var(--black);
  padding: 6px 0;
  border-radius: 4px;
  margin-bottom: 6px;
}

.calendar-grid-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.day-cell {
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 4px;
  padding: 4px 2px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--black);
  min-height: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.day-cell.empty {
  background: transparent;
  border: none;
}

.day-cell.weekend {
  background: #f1f5f9;
  color: #475569;
}

.day-cell.holiday {
  background: #dbeafe !important;
  color: #1e3a8a !important;
  border: 2px solid #2563eb !important;
  font-weight: 900 !important;
}

.day-cell.holiday.is-facultativo {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border: 2px solid #0284c7 !important;
}

.day-holiday-dot {
  font-size: 0.55rem;
  font-weight: 900;
  background: #2563eb;
  color: #ffffff;
  padding: 1px 3px;
  border-radius: 2px;
  margin-top: 2px;
  line-height: 1;
}

/* === RESPONSIVIDADE MOBILE IMPECÁVEL === */
@media (max-width: 900px) {
  .grid-months { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  html { font-size: 16px; }
  .container { padding: 0 16px; }
  header { position: relative !important; top: auto !important; }
  .header-inner { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
  .logo { justify-content: center; }
  .nav-links { width: 100%; justify-content: center; }
  .nav-links a { width: 100%; max-width: 280px; text-align: center; }
  
  .hero-section { padding: 28px 0 24px; margin-bottom: 24px; }
  .hero-title { font-size: 2.1rem; }
  
  .stats-row { grid-template-columns: 1fr; gap: 12px; }
  .stat-box { padding: 16px; }
  .stat-num { font-size: 2.4rem; }
  
  .tab-container { flex-direction: column; width: 100%; align-items: center; }
  .tab-btn { width: 100%; max-width: 100%; }
  
  .grid-months { grid-template-columns: 1fr; gap: 16px; }
  .month-card { min-height: auto; }
  
  .calc-card { padding: 24px 16px; box-shadow: 4px 4px 0px var(--black); }
  th, td { padding: 12px 10px; font-size: 0.9rem; }
  .day-cell { min-height: 34px; font-size: 0.78rem; padding: 2px 1px; }
}