/* ==========================================================================
   PORTAL DE DISCIPLINAS E MATERIAIS ACADEMICOS
   Prof. Dr. Santos Henrique Brant Dias | santoshbdias.com.br
   Padrao Visual Nobre e Eficiente: Suporte Completo a Dark/Light Mode e Mobile
   Conformidade WCAG AAA Integral (ERR-UI-003)
   ========================================================================== */

/* 1. VARIAVEIS E TEMAS (PADRAO: TEMA ESCURO) */
:root,
[data-theme="dark"] {
  --primary: #8dc63f;
  --primary-dark: #6fa62f;
  --primary-light: #a3e635;
  --btn-bg: linear-gradient(135deg, #8dc63f 0%, #6fa62f 100%);
  --btn-bg-hover: linear-gradient(135deg, #a3e635 0%, #8dc63f 100%);
  --btn-text: #090e17;
  --text: #f8fafc;
  --text-light: #cbd5e1;
  --text-dim: #94a3b8;
  --bg: #090e17;
  --card-bg: #111a28;
  --item-bg: #172336;
  --item-border: rgba(255, 255, 255, 0.1);
  --white: #111a28;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --topbar-bg: rgba(9, 14, 23, 0.92);
  --input-bg: #131d2e;
  --input-border: rgba(255, 255, 255, 0.15);
  --badge-bg: rgba(141, 198, 63, 0.16);
  --badge-text: #a3e635;
  --modal-bg: #111a28;
  --modal-overlay: rgba(0, 0, 0, 0.8);
  --chip-bg: #131d2e;
  --chip-text: #e2e8f0;
  --chip-border: rgba(255, 255, 255, 0.12);
}

[data-theme="light"] {
  --primary: #5a8f1f;
  --primary-dark: #467312;
  --primary-light: #6fa62f;
  --btn-bg: linear-gradient(135deg, #5a8f1f 0%, #467312 100%);
  --btn-bg-hover: linear-gradient(135deg, #467312 0%, #36590d 100%);
  --btn-text: #ffffff;
  --text: #0f172a;
  --text-light: #334155;
  --text-dim: #475569;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --item-bg: #f1f5f9;
  --item-border: rgba(15, 23, 42, 0.1);
  --white: #ffffff;
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.18);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --topbar-bg: rgba(255, 255, 255, 0.94);
  --input-bg: #ffffff;
  --input-border: rgba(15, 23, 42, 0.16);
  --badge-bg: rgba(90, 143, 31, 0.12);
  --badge-text: #3f6812;
  --modal-bg: #ffffff;
  --modal-overlay: rgba(15, 23, 42, 0.6);
  --chip-bg: #ffffff;
  --chip-text: #1e293b;
  --chip-border: rgba(15, 23, 42, 0.12);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

main, .container {
  width: min(1360px, 92%);
  margin: 0 auto;
  flex: 1;
}

.hidden {
  display: none !important;
}

/* 2. TOPBAR DE NAVEGACAO */
.topbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 4vw;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.logo-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  border: 1px solid var(--primary);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.2;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-topbar {
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 0.55rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--card-bg);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-topbar:hover,
.btn-topbar.active {
  background: var(--btn-bg);
  color: var(--btn-text) !important;
  border-color: var(--primary);
  transform: translateY(-2px);
  font-weight: 700;
}

/* BOTAO THEME TOGGLE */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.1rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* BOTAO HAMBURGUER MOBILE */
.menu-toggle-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  padding: 0;
  gap: 5px;
  transition: var(--transition);
  flex-shrink: 0;
}

.menu-toggle-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* 3. HERO SECTION */
.hero {
  padding: clamp(2.8rem, 5vw, 4.8rem) 0 clamp(1.8rem, 3.5vw, 3rem);
  text-align: center;
}

.badge {
  display: inline-block;
  padding: 0.45rem 1.15rem;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(141, 198, 63, 0.35);
}

.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 4rem);
  line-height: 1.12;
  font-weight: 900;
  margin-bottom: 1rem;
  color: var(--text);
}

.hero h1 span,
.hero span {
  color: var(--primary);
}

.hero p {
  width: min(760px, 94%);
  margin: auto;
  color: var(--text-light);
  font-size: clamp(0.98rem, 1.8vw, 1.12rem);
  line-height: 1.65;
}

/* 4. CAMPO DE PESQUISA & QUICK NAV */
.search-box {
  width: min(680px, 100%);
  margin: 2.2rem auto 1.2rem;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 1rem 1.5rem;
  border-radius: 14px;
  border: 1.5px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.search-box input::placeholder {
  color: var(--text-dim);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(141, 198, 63, 0.25);
}

.quick-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 1.6rem 0 2.8rem;
}

.quick-nav a {
  text-decoration: none;
  background: var(--chip-bg);
  color: var(--chip-text);
  border: 1px solid var(--chip-border);
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: var(--transition);
}

.quick-nav a:hover,
.quick-nav a.active {
  background: var(--btn-bg);
  color: var(--btn-text) !important;
  font-weight: 700;
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* 5. GRID DE CARDS PRINCIPAL (HUB DE DISCIPLINAS) */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.8rem;
  padding-bottom: 5rem;
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card {
  display: flex;
  flex-direction: column;
  text-align: center;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2.2rem 1.8rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: var(--transition);
  height: 100%;
  position: relative;
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.14);
}

[data-theme="dark"] .card:hover {
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
}

.icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--badge-bg);
  font-size: 1.7rem;
  margin: 0 auto 1.25rem;
}

.card h2 {
  font-size: 1.35rem;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: var(--text);
  font-weight: 800;
}

.card p {
  color: var(--text-light);
  margin-bottom: 1.8rem;
  font-size: 0.95rem;
  line-height: 1.55;
  flex-grow: 1;
}

.btn-material {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--btn-bg);
  color: var(--btn-text) !important;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.95rem;
  transition: var(--transition);
  margin-top: auto;
  box-shadow: 0 4px 14px rgba(141, 198, 63, 0.25);
}

.btn-material:hover {
  background: var(--btn-bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(141, 198, 63, 0.35);
}

/* 6. SECOES E CARDS DAS SUBPAGINAS (.resource-card, .download-list, .download-item) */
.section {
  margin-bottom: 4rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.65rem;
  font-weight: 800;
  margin-bottom: 1.8rem;
  color: var(--text);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.section-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--badge-bg);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}

.resource-card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 1.75rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.resource-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}

.resource-card h3 {
  font-size: 1.18rem;
  font-weight: 800;
  margin-bottom: 0.65rem;
  color: var(--text);
  line-height: 1.35;
}

.resource-card p {
  color: var(--text-light);
  font-size: 0.94rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

/* Quando o card nao possui .download-list, o paragrafo expande para alinhar o botao na base */
.resource-card:not(:has(.download-list)) p {
  flex-grow: 1;
}

.resource-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--badge-bg);
  color: var(--badge-text);
  margin-bottom: 0.85rem;
  width: fit-content;
}

/* Botoes de acao e download dentro de .resource-card */
.resource-card a:not(.video-thumb-container):not(.satellite-more):not(.video-button),
.download-gate,
.btn-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--btn-bg);
  color: var(--btn-text) !important;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(141, 198, 63, 0.2);
  line-height: 1.2;
}

.resource-card > a:not(.video-thumb-container) {
  align-self: flex-start;
  margin-top: auto;
}

.resource-card a:not(.video-thumb-container):not(.satellite-more):not(.video-button):hover,
.download-gate:hover,
.btn-card:hover {
  background: var(--btn-bg-hover);
  color: var(--btn-text) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(141, 198, 63, 0.35);
}

/* Lista de multiplos downloads dentro de um card (.download-list & .download-item) */
.download-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.download-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 14px;
  row-gap: 4px;
  padding: 12px 14px;
  background: var(--item-bg);
  border: 1px solid var(--item-border);
  border-radius: 12px;
  transition: var(--transition);
}

.download-item:hover {
  border-color: var(--primary);
}

.download-item > div {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.download-item span {
  grid-column: 1;
  display: block;
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.download-help {
  grid-column: 1;
  display: block;
  color: var(--text-light);
  font-size: 0.8rem;
  line-height: 1.4;
}

.download-item > a {
  grid-column: 2;
  grid-row: 1;
  min-width: 104px;
  text-align: center;
  padding: 9px 16px;
  font-size: 0.86rem;
  justify-self: end;
  align-self: center;
  white-space: nowrap;
}

.download-item:has(> .download-help) > a {
  grid-row: 1 / span 2;
}

/* 7. CARDS DE VIDEO (.video-card) */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.8rem;
}

.video-card {
  background: var(--card-bg);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.video-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}

.video-thumb-container {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000000;
  border-radius: 12px;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.video-card:hover .video-thumb {
  transform: scale(1.05);
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  background: rgba(9, 14, 23, 0.85);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 1.35rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  transition: var(--transition);
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.video-card:hover .play-icon,
.video-thumb-container:hover .play-icon {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  transform: translate(-50%, -50%) scale(1.1);
}

.resource-card a.video-button,
.video-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: #ffffff !important;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  text-decoration: none;
  transition: var(--transition);
  margin-top: auto;
  align-self: flex-start;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3) !important;
}

.resource-card a.video-button:hover,
.video-button:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45) !important;
}

/* 8. CARDS DE SATELITES (Sensoriamento Remoto) */
.satellite-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 3rem;
}

.satellite-info-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.35rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  transition: var(--transition);
}

.satellite-info-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
}

.satellite-info-card h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

.satellite-meta {
  display: grid;
  gap: 6px;
  color: var(--text-light);
  font-size: 0.88rem;
}

.satellite-meta strong {
  color: var(--text);
}

.satellite-more {
  display: inline-block;
  margin-top: 14px;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
}

.satellite-more:hover {
  color: var(--primary-light);
  transform: translateX(3px);
}

/* 9. MODAL DE DOWNLOAD COM GATE ("Disponivel para Inscritos") */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--modal-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--modal-bg);
  border-radius: 22px;
  padding: 2.4rem 2rem;
  max-width: 460px;
  width: 94%;
  border: 1px solid var(--border-strong);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
  position: relative;
  text-align: center;
}

#closeModal,
.close-modal {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--item-bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: var(--transition);
  line-height: 1;
}

#closeModal:hover,
.close-modal:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.modal-content h3 {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.modal-content p {
  color: var(--text-light);
  font-size: 0.98rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

#openChannel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px 24px;
  margin-top: 10px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #6f9d17 0%, #557c0f 100%);
  color: #ffffff !important;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(111, 157, 23, 0.35);
  transition: var(--transition);
}

#openChannel:hover {
  background: linear-gradient(135deg, #8dc63f 0%, #6f9d17 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(111, 157, 23, 0.5);
}

#checkingSubscription {
  display: none;
  margin-top: 20px;
  padding: 15px;
  background: rgba(220, 38, 38, 0.14);
  border: 2px solid #ef4444;
  color: #fca5a5;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 12px;
  animation: pulseCheck 1s infinite;
}

[data-theme="light"] #checkingSubscription {
  background: #ffebeb;
  border: 2px solid #d60000;
  color: #b91c1c;
}

@keyframes pulseCheck {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  }
  70% {
    transform: scale(1.02);
    box-shadow: 0 0 0 14px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

#countdown {
  margin-top: 18px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #ef4444;
}

[data-theme="light"] #countdown {
  color: #dc2626;
}

#realDownload {
  display: none;
  width: 100%;
  margin-top: 20px;
  padding: 16px 24px;
  justify-content: center;
  align-items: center;
  background: var(--btn-bg);
  color: var(--btn-text) !important;
  border-radius: 999px;
  text-decoration: none;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 24px rgba(141, 198, 63, 0.35);
  transition: var(--transition);
}

#realDownload:hover {
  background: var(--btn-bg-hover);
  transform: translateY(-2px);
}

/* 10. GAVETA LATERAL DO MENU MOBILE (DRAWER) */
body.drawer-locked {
  overflow: hidden !important;
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: var(--modal-bg);
  border-left: 1px solid var(--border-strong);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
}

.mobile-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-brand-text .drawer-name {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.drawer-brand-text .drawer-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--text-light);
}

.drawer-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--item-bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition);
}

.drawer-theme-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  background: var(--item-bg);
  border-bottom: 1px solid var(--border);
}

.drawer-theme-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
}

.drawer-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.theme-switch-pill {
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  padding: 2px;
  transition: var(--transition);
}

.theme-switch-knob {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.25s ease;
  transform: translateX(14px);
}

.drawer-theme-toggle.is-light .theme-switch-pill {
  background: #f59e0b;
}

.drawer-theme-toggle.is-light .theme-switch-knob {
  transform: translateX(0);
}

.drawer-nav {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.drawer-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: var(--transition);
  min-height: 48px;
}

.drawer-nav a:hover,
.drawer-nav a.active {
  background: var(--badge-bg);
  color: var(--badge-text);
}

.drawer-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border);
}

.btn-drawer-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--btn-bg);
  color: var(--btn-text) !important;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(141, 198, 63, 0.3);
  min-height: 48px;
}

/* 11. BACK TO TOP & FOOTER */
.back-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--btn-bg);
  color: var(--btn-text) !important;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 900;
}

.back-top:hover {
  background: var(--btn-bg-hover);
  transform: translateY(-3px);
}

footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 2.8rem 1rem;
  text-align: center;
  margin-top: auto;
  transition: var(--transition);
}

footer p {
  color: var(--text-light);
  font-size: 0.92rem;
  margin-bottom: 0.6rem;
}

footer a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
}

footer a:hover {
  text-decoration: underline;
}

/* 12. RESPONSIVIDADE MOBILE (SMARTPHONES) */
@media (max-width: 768px) {
  .topbar {
    padding: 0.75rem 14px;
  }
  .brand-group {
    gap: 8px;
  }
  .logo-badge {
    width: 36px;
    height: 36px;
    font-size: 0.88rem;
    border-radius: 10px;
  }
  .brand-name {
    font-size: 0.88rem;
  }
  .brand-sub {
    display: none;
  }
  .topbar-nav {
    display: none;
  }
  .menu-toggle-btn {
    display: inline-flex;
  }
  .hero {
    padding: 32px 0 20px;
  }
  .hero h1 {
    font-size: clamp(1.75rem, 7vw, 2.35rem);
  }
  .cards-grid,
  .resource-grid,
  .video-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .card,
  .resource-card {
    padding: 20px 16px;
  }
  .section-title {
    font-size: 1.35rem;
  }
  .section-icon {
    width: 40px;
    height: 40px;
    font-size: 1.15rem;
  }
  .quick-nav {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    gap: 8px;
    margin: 1.4rem 0 2rem;
    -webkit-overflow-scrolling: touch;
  }
  .quick-nav a {
    padding: 8px 14px;
    font-size: 0.84rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .download-item {
    grid-template-columns: 1fr;
    row-gap: 10px;
  }
  .download-item > a,
  .download-item:has(> .download-help) > a {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    justify-self: stretch;
  }
  .resource-card > a:not(.video-thumb-container) {
    width: 100%;
  }
  .modal-content {
    padding: 2rem 1.4rem;
  }
}


/* RODAPE INSTITUCIONAL PADRONIZADO (.site-footer) */
footer.site-footer {
  background: #040906;
  color: #94a3b8;
  padding: 80px 24px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  margin-top: auto;
}

footer.site-footer .container {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}

footer.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 48px;
  margin-bottom: 60px;
}

footer.site-footer .brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

footer.site-footer .brand-logo img {
  width: 44px;
  height: 48px;
}

footer.site-footer .brand-text .title {
  color: #ffffff;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.5px;
  margin-bottom: 0;
}

footer.site-footer .brand-text .subtitle {
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

footer.site-footer .footer-col > .title {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 20px;
}

footer.site-footer .footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  margin: 0;
}

footer.site-footer .footer-links a,
footer.site-footer .footer-links span {
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: var(--transition);
}

footer.site-footer .footer-links a:hover {
  color: #34d399;
  padding-left: 4px;
  text-decoration: none;
}

footer.site-footer .social-links {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

footer.site-footer .social-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

footer.site-footer .social-btn:hover {
  background: #f59e0b;
}

footer.site-footer .social-btn img {
  width: 20px;
  height: 20px;
}

footer.site-footer .footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 16px;
  color: #94a3b8;
}

[data-theme="light"] footer.site-footer {
  background: #f1f5f9 !important;
  border-top: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

[data-theme="light"] footer.site-footer .brand-text .title,
[data-theme="light"] footer.site-footer .footer-col > .title {
  color: #0f172a !important;
}

[data-theme="light"] footer.site-footer .brand-text .subtitle {
  color: #b45309 !important;
}

[data-theme="light"] footer.site-footer p {
  color: #334155 !important;
}

[data-theme="light"] footer.site-footer .footer-links a,
[data-theme="light"] footer.site-footer .footer-links span {
  color: #334155 !important;
}

[data-theme="light"] footer.site-footer .footer-links a:hover {
  color: #047857 !important;
}

[data-theme="light"] footer.site-footer .footer-links li {
  color: #b45309 !important;
}

[data-theme="light"] footer.site-footer .social-btn {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] footer.site-footer .social-btn:hover {
  background: #10b981 !important;
  border-color: #059669 !important;
}

[data-theme="light"] footer.site-footer .footer-bottom {
  border-top-color: #cbd5e1 !important;
  color: #475569 !important;
}

@media (max-width: 1024px) {
  footer.site-footer .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  footer.site-footer .footer-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}
