/* ============================================================
   A&7 · Reforma Tributária — Componentes
   (header, nav, botões, cards, footer, modal)
   ============================================================ */

/* ---------- Header fixo ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--header-bg);
  color: var(--header-ink);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.nav {
  width: min(var(--max), calc(100% - 32px));
  height: 100%;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -.05em;
  font-size: 1.12rem;
}
.logo-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  color: #fff;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(47,107,255,.95), rgba(107,50,255,.95));
  box-shadow: 0 8px 26px rgba(47,107,255,.4);
  font-size: .7rem;
  letter-spacing: -.06em;
}
.logo small {
  display: block;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: -3px;
}

.desktop-nav { display: none; align-items: center; gap: 4px; }
.desktop-nav a {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 650;
  padding: 11px 13px;
  border-radius: 999px;
  transition: .25s ease;
}
.desktop-nav a:hover { color: var(--ink); background: var(--surface-2); }

.nav-right { display: flex; align-items: center; gap: 10px; }

/* ---- Toggle de tema ---- */
.theme-toggle {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  transition: transform .22s ease, background .22s ease, border-color .22s ease;
}
.theme-toggle:hover { transform: translateY(-2px) rotate(12deg); background: var(--surface-2); border-color: var(--blue); }
.theme-toggle svg { width: 19px; height: 19px; transition: transform .35s ease; }
.theme-toggle .icon-dark { display: none; }
html[data-theme="dark"] .theme-toggle .icon-dark { display: block; }
html[data-theme="dark"] .theme-toggle .icon-light { display: none; }

.nav-cta { display: none; }

/* ---- Menu mobile ---- */
.menu-button {
  width: 42px; height: 42px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
  border-radius: 13px;
  display: grid; place-items: center;
}
.menu-button span, .menu-button span::before, .menu-button span::after {
  display: block;
  width: 18px; height: 2px;
  border-radius: 99px;
  background: currentColor;
  content: "";
  transition: .25s ease;
}
.menu-button span::before { transform: translateY(-6px); }
.menu-button span::after { transform: translateY(4px); }

.mobile-menu {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 999;
  background: var(--surface);
  color: var(--ink);
  padding: 22px 20px 40px;
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
  transition: .35s ease;
}
.mobile-menu.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.mobile-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 1.1rem;
  font-weight: 750;
}
.mobile-menu .btn { margin-top: 22px; }

/* ---- Progresso de leitura ---- */
.reading-progress {
  position: fixed;
  top: var(--header-h);
  left: 0;
  z-index: 1001;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--violet));
}

/* ---------- Botões ---------- */
.button-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}
.btn {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 850;
  font-size: .95rem;
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease, border-color .22s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  color: #fff;
  background: linear-gradient(110deg, var(--blue), var(--violet));
  box-shadow: 0 14px 36px rgba(61, 89, 255, .34);
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.25) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: shimmer 2.8s ease-in-out infinite;
  pointer-events: none;
}
.btn-primary:hover { box-shadow: 0 18px 44px rgba(61, 89, 255, .46); }
.btn-outline {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.dark-section .btn-outline {
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: #fff;
}
.dark-section .btn-outline:hover { border-color: #7fa6ff; color: #fff; }
.btn-ghost { color: var(--ink); background: transparent; }
.btn-green {
  color: #fff;
  background: linear-gradient(110deg, #0fa37f, var(--teal));
  box-shadow: 0 14px 36px rgba(21, 195, 160, .32);
}
.btn-green:hover { box-shadow: 0 18px 44px rgba(21, 195, 160, .44); }
.btn-block { width: 100%; }

@media (min-width: 900px) {
  .desktop-nav { display: flex; }
  .nav-cta { display: inline-flex; }
  .menu-button { display: none; }
  .button-row { flex-direction: row; }
}

/* ---------- Cards / pilares ---------- */
.pillar-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 26px;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.pillar-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-sm);
  border-color: var(--line-strong);
}
.pillar-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 14px;
  font-size: 1.3rem;
  background: linear-gradient(135deg, rgba(47,107,255,.16), rgba(21,195,160,.16));
  margin-bottom: 16px;
}
.pillar-card h3 { font-size: 1.12rem; letter-spacing: -.02em; margin-bottom: 8px; }
.pillar-card p { color: var(--muted); font-size: .93rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--dark-2);
  color: #fff;
  padding: 56px 0 30px;
}
.footer-grid {
  display: grid;
  gap: 32px;
  padding-bottom: 34px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-brand p { color: rgba(255,255,255,.62); font-size: .92rem; margin-top: 14px; max-width: 340px; }
.footer-contact { color: rgba(255,255,255,.62); font-size: .9rem; margin-top: 16px; line-height: 1.7; }
.footer-links { display: grid; gap: 20px; grid-template-columns: repeat(2, 1fr); }
.footer-links strong {
  display: block;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  margin-bottom: 12px;
}
.footer-links a { display: block; color: rgba(255,255,255,.78); font-size: .9rem; padding: 6px 0; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 24px;
  color: rgba(255,255,255,.42);
  font-size: .8rem;
}
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr; }
  .footer-bottom { flex-direction: row; justify-content: space-between; }
}

/* ---------- Modal (código) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 9, 16, .66);
  backdrop-filter: blur(6px);
  animation: fadeIn .25s ease;
}
.modal-card {
  position: relative;
  width: min(660px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 22px;
  box-shadow: var(--shadow);
  animation: rise .3s ease;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.modal-close {
  width: 34px; height: 34px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 1.1rem;
  transition: .2s ease;
}
.modal-close:hover { background: var(--surface-3); }
.code-block {
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: var(--radius-xs);
  padding: 18px;
  font-size: .76rem;
  line-height: 1.6;
  overflow: auto;
  font-family: ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, monospace;
  white-space: pre;
}
.modal-card .btn { margin-top: 16px; }
