:root {
  --br-green-1: #009e2a;
  --br-green-2: #62c370;
  --br-yellow: #f4d35e;
  --br-blue: #0a2f5a;
  --bg-offwhite: #f8f9fa;
  --surface: #ffffff;
  --text-main: #1f2933;
  --text-soft: #52606d;
  --border-soft: #d9e2ec;
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 16px 28px rgba(10, 47, 90, 0.18);
}

html,
body {
  background: var(--bg-offwhite);
  color: var(--text-main);
  font-family: "Poppins", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.page-shell {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1200;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.site-navbar {
  background: linear-gradient(135deg, var(--br-green-1), var(--br-green-2));
  padding: 0.9rem 1rem;
}

.site-nav-inner {
  display: flex;
  align-items: center;
}

.site-brand {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.site-brand:hover,
.site-brand:focus {
  color: #fff;
}

.site-nav-links .nav-link {
  color: #fff;
  font-weight: 500;
  margin-left: 0.45rem;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
}

.site-nav-links .nav-link:hover,
.site-nav-links .nav-link:focus {
  color: var(--br-blue);
  background: var(--br-yellow);
}

.site-toggler {
  border-color: rgba(255, 255, 255, 0.6);
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.site-toggler:focus {
  box-shadow: 0 0 0 0.22rem rgba(244, 211, 94, 0.5);
}

.site-main {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.hero-section {
  background: radial-gradient(circle at top right, #e7f7eb, #ffffff 60%);
  border: 1px solid var(--border-soft);
  border-radius: 24px;
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: var(--shadow-soft);
  margin-bottom: 2rem;
}

.hero-content {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.hero-kicker {
  color: var(--br-blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.hero-content h1 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  color: var(--text-main);
}

.hero-subtitle {
  color: var(--text-soft);
  max-width: 68ch;
  margin: 0 auto 1.25rem;
}

.hero-search-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.6rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 0.65rem;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
}

.hero-search-form .form-control {
  border: 1px solid #bcccdc;
  border-radius: 12px;
  min-height: 48px;
}

.hero-search-form .btn-primary,
.home-cta .btn-primary {
  background: linear-gradient(135deg, var(--br-green-1), var(--br-green-2));
  border: none;
  color: #fff;
  border-radius: 12px;
}

.hero-search-form .btn-primary:hover,
.home-cta .btn-primary:hover {
  filter: brightness(0.95);
}

.hero-search-form .btn-outline-secondary {
  border-color: #9fb3c8;
  color: var(--br-blue);
  border-radius: 12px;
}

.hero-search-form .btn-outline-secondary:hover {
  background: var(--br-yellow);
  border-color: var(--br-yellow);
  color: var(--br-blue);
}

.hero-examples {
  margin-top: 0.9rem;
  color: var(--text-soft);
}

.hero-examples a {
  color: var(--br-blue);
  text-decoration: none;
}

.hero-examples a:hover {
  text-decoration: underline;
}

.content-section {
  margin-top: 1.8rem;
}

.section-header h2,
.content-section h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.45rem;
}

.law-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.law-grid--recent {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.law-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.law-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.law-card h3 {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.4;
}

.law-card h3 a {
  color: var(--text-main);
  text-decoration: none;
}

.law-card h3 a:hover {
  color: var(--br-blue);
}

.law-card-meta {
  margin-top: 0.9rem;
  display: flex;
  justify-content: flex-end;
}

.law-like-count {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  background: #eafbea;
  color: #136f36;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-weight: 600;
  font-size: 0.86rem;
}

.law-date {
  margin-top: 0.85rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.topic-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  background: #e6f0fa;
  color: var(--br-blue);
  border: 1px solid #bfd5ea;
  padding: 0.35rem 0.75rem;
  text-decoration: none;
  font-weight: 500;
}

.topic-chip:hover {
  background: var(--br-yellow);
  border-color: var(--br-yellow);
  color: var(--br-blue);
}

.home-cta {
  margin-top: 2.2rem;
  text-align: center;
  background: #fffef7;
  border: 1px solid #f3e3ac;
  border-radius: 18px;
  padding: 1.25rem;
}

.home-cta p {
  margin-bottom: 0.9rem;
  color: var(--text-soft);
}

.newsletter-box {
  margin-top: 1.5rem;
  padding: 1.1rem;
  border-radius: 16px;
  border: 1px solid #b7e4c7;
  background: linear-gradient(180deg, #f2fff6 0%, #ffffff 100%);
  box-shadow: var(--shadow-soft);
}

.newsletter-box h2 {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  color: #0f5132;
}

.newsletter-box p {
  margin-bottom: 0.8rem;
  color: var(--text-soft);
}

.newsletter-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  align-items: end;
}

.newsletter-form .form-control {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid #c8d6c5;
}

.newsletter-submit {
  grid-column: 1 / -1;
  min-height: 44px;
  border-radius: 10px;
  border: none;
  color: #fff;
  background: linear-gradient(135deg, var(--br-green-1), var(--br-green-2));
}

.newsletter-submit:hover {
  filter: brightness(0.95);
  color: #fff;
}

.reading-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1.2rem;
  width: 100%;
  max-width: 100%;
}

.reading-layout > * {
  min-width: 0;
}

.reading-header {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

.reading-kicker {
  margin: 0;
  color: var(--br-blue);
  font-weight: 600;
}

.reading-header h1 {
  margin-top: 0.35rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

.reading-container {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  max-width: 100%;
  padding: clamp(1rem, 2vw, 2rem);
  box-shadow: var(--shadow-soft);
  line-height: 1.72;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  hyphens: auto;
}

.reading-container h2,
.reading-container h3,
.reading-container h4 {
  color: #243b53;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

.reading-container p,
.reading-container li {
  color: #334e68;
}

.reading-container ul,
.reading-container ol {
  margin-left: 0;
  padding-left: 1.25rem;
}

.reading-container pre,
.reading-container table,
.doc-reading pre,
.doc-reading table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.avaliacao-lei .btn {
  min-height: 44px;
}

.reading-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.reading-sidebar a {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 0.95rem;
}

.info-card h2 {
  font-size: 1rem;
  margin: 0 0 0.7rem;
}

.metrics-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.metrics-list li {
  margin-bottom: 0.4rem;
  color: var(--text-soft);
}

.aviso-legal {
  grid-column: 1 / -1;
  border: 1px solid var(--border-soft);
  background: #f4f7fb !important;
}

.content-doc-page {
  background: transparent;
}

.doc-hero {
  margin-bottom: 1rem;
}

.doc-hero h1 {
  margin-top: 0;
}

.doc-subtitle {
  color: var(--text-soft);
}

.doc-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 1rem;
}

.doc-sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
}

.toc-accordion > summary {
  display: none;
}

.toc-nav {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 0.9rem;
  box-shadow: var(--shadow-soft);
}

.toc-nav h2 {
  font-size: 1rem;
  margin: 0 0 0.7rem;
}

.toc-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-nav li + li {
  margin-top: 0.3rem;
}

.toc-nav a {
  color: #2f4f6f;
  text-decoration: none;
  font-size: 0.92rem;
}

.toc-nav a:hover {
  color: var(--br-blue);
  text-decoration: underline;
}

.doc-reading {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  max-width: 800px;
  padding: clamp(1rem, 2vw, 2rem);
  box-shadow: var(--shadow-soft);
  overflow-wrap: anywhere;
}

.doc-section {
  scroll-margin-top: 110px;
}

.doc-section + .doc-section {
  margin-top: 1.4rem;
}

.avaliacao-positiva {
  background-color: #d4edda;
  color: #155724;
}

.avaliacao-negativa {
  background-color: #f8d7da;
  color: #721c24;
}

.devsite-thumb-rating {
  display: flex;
  gap: 10px;
}

.site-footer {
  margin-top: 2rem;
  border-top: 1px solid #d9e2ec;
  background: #eef2f7;
  padding: 1.6rem 0 1rem;
}

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

.footer-title,
.footer-subtitle {
  margin-top: 0;
  margin-bottom: 0.6rem;
}

.footer-title {
  font-size: 1.15rem;
}

.footer-subtitle {
  font-size: 1rem;
}

.footer-text {
  color: #486581;
  margin-bottom: 0;
}

.footer-links-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links-list li + li {
  margin-top: 0.35rem;
}

.footer-links-list a {
  text-decoration: none;
  color: var(--br-blue);
}

.footer-links-list a:hover {
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid #c7d4e2;
  margin-top: 1rem;
  padding-top: 0.7rem;
  color: #334e68;
  text-align: center;
  font-size: 0.9rem;
}

@media (max-width: 1100px) {
  .law-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reading-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .doc-layout {
    grid-template-columns: 1fr;
  }

  .doc-sidebar {
    position: static;
  }

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

@media (max-width: 768px) {
  .site-navbar .navbar-collapse {
    margin-top: 0.7rem;
    background: rgba(10, 47, 90, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 12px;
    padding: 0.55rem;
  }

  .site-nav-links .nav-link {
    margin-top: 0.3rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

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

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

  .law-grid,
  .law-grid--recent {
    grid-template-columns: 1fr;
  }

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

  .site-nav-links .nav-link {
    margin-left: 0;
  }

  .doc-sidebar {
    order: -1;
  }

  .toc-accordion {
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
  }

  .toc-accordion > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    color: var(--br-blue);
    padding: 0.9rem;
  }

  .toc-accordion > summary::-webkit-details-marker {
    display: none;
  }

  .toc-accordion > summary::after {
    content: "+";
    font-size: 1.2rem;
    line-height: 1;
  }

  .toc-accordion[open] > summary::after {
    content: "-";
  }

  .toc-accordion .toc-nav {
    border: none;
    border-top: 1px solid var(--border-soft);
    box-shadow: none;
    border-radius: 0 0 14px 14px;
  }

  .page-shell {
    width: calc(100% - 1.2rem);
  }
}