/* ================================================================
   GERADOR INTELIGENTE DE PLANO DE AULA — CIÊNCIAS EF II
   Estilo: editorial científico + glassmorphism refinado
   Paleta: azul-petróleo profundo + âmbar vivo + creme/grafite
   Tipografia: Fraunces (display) + Manrope (texto)
   ================================================================ */

/* ---------- Reset enxuto ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { min-height: 100vh; font-family: 'Manrope', system-ui, sans-serif; background: var(--bg); color: var(--text); transition: background .35s ease, color .35s ease; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* ---------- Tokens (tema claro) ---------- */
:root[data-theme="light"], body[data-theme="light"] {
  --bg: #f4efe6;                       /* creme claro */
  --bg-tint: #ebe4d6;
  --surface: rgba(255, 252, 246, 0.72);
  --surface-solid: #fffcf6;
  --surface-strong: rgba(255, 252, 246, 0.92);
  --border: rgba(15, 47, 56, 0.12);
  --border-strong: rgba(15, 47, 56, 0.22);
  --text: #0f2f38;                     /* azul-petróleo escuro */
  --text-soft: #4a6770;
  --text-mute: #7a8e94;
  --primary: #0f2f38;                  /* azul-petróleo */
  --primary-2: #1a4853;
  --accent: #d97706;                   /* âmbar */
  --accent-2: #b45309;
  --accent-soft: #fde68a;
  --danger: #b91c1c;
  --success: #15803d;
  --shadow-sm: 0 1px 2px rgba(15, 47, 56, .06);
  --shadow-md: 0 8px 24px -8px rgba(15, 47, 56, .15);
  --shadow-lg: 0 24px 60px -20px rgba(15, 47, 56, .25);
  --grid-line: rgba(15, 47, 56, 0.06);
  --orb-1: radial-gradient(circle, rgba(217, 119, 6, .35), transparent 65%);
  --orb-2: radial-gradient(circle, rgba(15, 47, 56, .28), transparent 65%);
  --orb-3: radial-gradient(circle, rgba(180, 83, 9, .25), transparent 65%);
}

/* ---------- Tokens (tema escuro) ---------- */
:root[data-theme="dark"], body[data-theme="dark"] {
  --bg: #0a1a1f;
  --bg-tint: #0f2027;
  --surface: rgba(18, 38, 45, 0.7);
  --surface-solid: #122932;
  --surface-strong: rgba(18, 38, 45, 0.92);
  --border: rgba(244, 239, 230, 0.1);
  --border-strong: rgba(244, 239, 230, 0.22);
  --text: #f4efe6;
  --text-soft: #b8c5c9;
  --text-mute: #7d8f96;
  --primary: #f4efe6;
  --primary-2: #ebe4d6;
  --accent: #f59e0b;
  --accent-2: #d97706;
  --accent-soft: #92400e;
  --danger: #f87171;
  --success: #4ade80;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .25);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
  --grid-line: rgba(244, 239, 230, 0.04);
  --orb-1: radial-gradient(circle, rgba(245, 158, 11, .25), transparent 65%);
  --orb-2: radial-gradient(circle, rgba(125, 211, 252, .15), transparent 65%);
  --orb-3: radial-gradient(circle, rgba(217, 119, 6, .18), transparent 65%);
}

/* ================================================================
   CAMADAS DE FUNDO
   ================================================================ */
.bg-layer { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.bg-grid {
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at top, black 30%, transparent 80%);
}
.bg-orbs .orb { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .8; animation: float 18s ease-in-out infinite; }
.orb-1 { width: 520px; height: 520px; top: -120px; right: -120px; background: var(--orb-1); animation-delay: 0s; }
.orb-2 { width: 380px; height: 380px; bottom: 10%; left: -100px; background: var(--orb-2); animation-delay: -7s; }
.orb-3 { width: 300px; height: 300px; top: 50%; right: 20%; background: var(--orb-3); animation-delay: -12s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.06); }
  66%      { transform: translate(-30px, 20px) scale(.96); }
}
.bg-noise {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .25 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .35;
  mix-blend-mode: multiply;
}
body[data-theme="dark"] .bg-noise { mix-blend-mode: overlay; opacity: .25; }

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 248px;
  z-index: 50;
  display: flex; flex-direction: column;
  background: var(--surface);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  transition: transform .3s cubic-bezier(.22,1,.36,1), background .35s;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: var(--bg);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}
.brand-mark svg { width: 26px; height: 26px; animation: spinSlow 30s linear infinite; }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-title { font-family: 'Fraunces', serif; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.brand-title em { font-style: italic; color: var(--accent); font-weight: 500; }
.brand-sub { font-size: .7rem; color: var(--text-mute); letter-spacing: .12em; text-transform: uppercase; margin-top: 4px; }

.sidebar-close { display: none; width: 36px; height: 36px; border-radius: 10px; }
.sidebar-close:hover { background: var(--border); }
.sidebar-close svg { width: 18px; height: 18px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: .92rem; font-weight: 500;
  color: var(--text-soft);
  transition: all .2s ease;
  text-align: left;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--border); color: var(--text); }
.nav-item.active { background: var(--primary); color: var(--bg); font-weight: 600; }
.nav-item.active svg { stroke-width: 2; }

.sidebar-foot { border-top: 1px solid var(--border); padding-top: 16px; }
.theme-toggle {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: .9rem; font-weight: 500;
  color: var(--text-soft);
  transition: all .2s;
}
.theme-toggle:hover { background: var(--border); color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; }
.ico-sun, .ico-moon { display: inline-flex; }
body[data-theme="light"] .ico-moon { display: none; }
body[data-theme="dark"] .ico-sun { display: none; }

/* Toggle menu (mobile) */
.menu-toggle {
  display: none;
  position: fixed; top: 16px; left: 16px;
  z-index: 60;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--surface-strong);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  align-items: center; justify-content: center;
}
.menu-toggle svg { width: 22px; height: 22px; }

/* ================================================================
   CONTEÚDO PRINCIPAL
   ================================================================ */
.main {
  margin-left: 248px;
  padding: 48px 56px 80px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.view { display: none; animation: fadeIn .45s cubic-bezier(.22,1,.36,1); }
.view.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   HERO
   ================================================================ */
.hero { max-width: 880px; padding: 32px 0 56px; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .78rem; font-weight: 500;
  color: var(--text-soft);
  letter-spacing: .03em;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}
.hero-tag .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(217, 119, 6, .2);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

.hero-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}
.hero-title em { font-style: italic; font-weight: 500; color: var(--text-soft); }
.title-highlight { position: relative; display: inline-block; color: var(--accent); }
.title-underline {
  position: absolute; left: 0; right: 0; bottom: -10px;
  width: 100%; height: 12px;
  color: var(--accent);
  opacity: .8;
}
.hero-lead {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-soft);
  max-width: 640px;
  margin-bottom: 32px;
}
.hero-lead strong { color: var(--text); font-weight: 600; }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 48px; }
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: .95rem; font-weight: 600;
  transition: all .2s cubic-bezier(.22,1,.36,1);
  white-space: nowrap;
}
.btn-primary svg, .btn-ghost svg { width: 18px; height: 18px; }
.btn-primary {
  background: var(--primary);
  color: var(--bg);
  box-shadow: var(--shadow-md);
}
.btn-primary:hover {
  background: var(--primary-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.btn-primary.danger { background: var(--danger); color: white; }
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: var(--surface-strong); border-color: var(--text-soft); }
.btn-ghost.danger { color: var(--danger); border-color: var(--danger); }
.btn-ghost.danger:hover { background: var(--danger); color: white; }

.hero-stats {
  display: flex; align-items: center; gap: 24px;
  padding: 20px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  width: fit-content;
  box-shadow: var(--shadow-sm);
}
.stat { display: flex; flex-direction: column; line-height: 1; }
.stat-num { font-family: 'Fraunces', serif; font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-lbl { font-size: .72rem; color: var(--text-mute); letter-spacing: .1em; text-transform: uppercase; margin-top: 6px; }
.stat-sep { width: 1px; height: 36px; background: var(--border-strong); }

/* ================================================================
   FEATURE CARDS
   ================================================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  max-width: 1100px;
}
.feat-card {
  position: relative;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  transition: all .3s cubic-bezier(.22,1,.36,1);
}
.feat-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(135deg, transparent 0%, var(--accent-soft) 100%);
  opacity: 0; transition: opacity .3s;
  pointer-events: none;
}
.feat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.feat-card:hover::before { opacity: .15; }
.feat-ico {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: var(--bg-tint);
  color: var(--accent);
  border-radius: 12px;
  margin-bottom: 16px;
}
.feat-ico svg { width: 24px; height: 24px; }
.feat-card h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.feat-card p { font-size: .9rem; color: var(--text-soft); line-height: 1.55; }

/* ================================================================
   PÁGINAS (head)
   ================================================================ */
.page-head { margin-bottom: 32px; max-width: 720px; }
.page-head h2 {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.page-head p { color: var(--text-soft); font-size: 1rem; }

/* ================================================================
   PROGRESS BAR
   ================================================================ */
.progress-bar {
  position: relative;
  height: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 28px;
  overflow: visible;
  max-width: 1100px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width .5s cubic-bezier(.22,1,.36,1);
}
.progress-label {
  position: absolute; right: 0; top: -28px;
  font-size: .8rem; color: var(--text-mute); font-weight: 500;
  letter-spacing: .04em;
}

/* ================================================================
   FORMULÁRIO
   ================================================================ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 1100px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field-wide { grid-column: 1 / -1; }
.field label {
  display: flex; align-items: center; gap: 10px;
  font-size: .82rem; font-weight: 600;
  color: var(--text);
  letter-spacing: .01em;
}
.field-num {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  font-size: .7rem;
  font-family: 'Fraunces', serif;
  font-weight: 700;
}
.opt { font-weight: 400; color: var(--text-mute); font-size: .78rem; }

.field select, .field input[type="number"], .field textarea {
  padding: 12px 14px;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: .95rem;
  color: var(--text);
  transition: all .2s;
  backdrop-filter: blur(8px);
}
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a8e94' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; padding-right: 40px; cursor: pointer; }
.field textarea { resize: vertical; min-height: 80px; font-family: inherit; }
.field select:focus, .field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217, 119, 6, .2); }
.field select:disabled { opacity: .45; cursor: not-allowed; }

/* Chips de recursos */
.chip-group {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: var(--bg-tint);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .85rem;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.chip input { display: none; }
.chip:hover { background: var(--border); }
.chip:has(input:checked) {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}

.form-actions { grid-column: 1 / -1; display: flex; gap: 12px; justify-content: flex-end; margin-top: 16px; }

/* ================================================================
   RESULT — LESSON PLAN
   ================================================================ */
.result-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap; gap: 12px;
}
.toolbar-right { display: flex; gap: 10px; flex-wrap: wrap; }

.lesson-plan {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 56px 56px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  max-width: 920px;
  margin: 0 auto;
}

.lp-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 32px;
  gap: 24px;
  flex-wrap: wrap;
}
.lp-head .lp-id {
  font-size: .72rem; color: var(--text-mute);
  letter-spacing: .15em; text-transform: uppercase;
  margin-bottom: 6px;
}
.lp-head h1 {
  font-family: 'Fraunces', serif;
  font-size: 2rem; font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.lp-head .lp-meta {
  text-align: right;
  font-size: .8rem;
  color: var(--text-soft);
}
.lp-head .lp-meta strong { display: block; color: var(--accent); font-family: 'Fraunces', serif; font-size: 1.15rem; }

.lp-section { margin-bottom: 28px; }
.lp-section h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem; font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.005em;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 10px;
}
body[data-theme="dark"] .lp-section h2 { color: var(--accent); }
.lp-section h2::before {
  content: ''; width: 24px; height: 2px;
  background: var(--accent);
  display: inline-block;
}
.lp-section p, .lp-section li { font-size: .95rem; line-height: 1.65; color: var(--text); }
.lp-section ul { padding-left: 22px; }
.lp-section li { margin-bottom: 6px; }
.lp-section .lp-tag {
  display: inline-block;
  font-size: .75rem; font-weight: 600;
  padding: 3px 10px;
  background: var(--bg-tint);
  color: var(--text-soft);
  border-radius: 999px;
  margin-right: 6px; margin-bottom: 4px;
  border: 1px solid var(--border);
}

.lp-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  padding: 20px;
  background: var(--bg-tint);
  border-radius: 14px;
  margin-bottom: 28px;
}
.lp-info-cell .lbl { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute); margin-bottom: 4px; }
.lp-info-cell .val { font-size: .95rem; font-weight: 600; }

.lp-foot {
  margin-top: 40px; padding-top: 20px;
  border-top: 2px solid var(--border);
  display: flex; flex-direction: column;
  gap: 18px;
  font-size: .78rem; color: var(--text-mute);
}
.lp-foot-author {
  text-align: center;
  padding: 16px 12px;
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.06), rgba(15, 47, 56, 0.04));
  border-radius: 12px;
  border: 1px dashed var(--border-strong);
}
.lp-foot-line {
  margin: 0 0 4px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
.lp-foot-line strong {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.lp-foot-legal {
  font-size: 0.72rem !important;
  font-style: italic;
  opacity: 0.9;
}
.lp-foot-contact {
  font-size: 0.74rem !important;
  color: var(--accent) !important;
  font-weight: 500;
  margin-top: 4px;
}
.lp-foot-meta {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  font-size: 0.74rem;
  padding-top: 8px;
  border-top: 1px dotted var(--border);
}
.lp-sig { font-family: 'Fraunces', serif; font-style: italic; }

/* ================================================================
   HISTÓRICO
   ================================================================ */
.history-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; margin-bottom: 24px; flex-wrap: wrap;
}
.search-box {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  width: 100%; max-width: 420px;
  backdrop-filter: blur(10px);
}
.search-box svg { width: 18px; height: 18px; color: var(--text-mute); flex-shrink: 0; }
.search-box input { flex: 1; border: none; background: transparent; outline: none; font-size: .95rem; }

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.hist-card {
  position: relative;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  transition: all .25s;
  cursor: pointer;
}
.hist-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.hist-card .hc-tag {
  display: inline-block;
  font-size: .7rem; font-weight: 600;
  padding: 3px 10px;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  margin-bottom: 12px;
}
.hist-card h4 {
  font-family: 'Fraunces', serif;
  font-size: 1.05rem; font-weight: 600;
  line-height: 1.3;
  margin-bottom: 8px;
}
.hist-card .hc-sub { font-size: .82rem; color: var(--text-soft); margin-bottom: 12px; line-height: 1.4; }
.hist-card .hc-date { font-size: .72rem; color: var(--text-mute); letter-spacing: .04em; }
.hist-card .hc-del {
  position: absolute; top: 16px; right: 16px;
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--text-mute);
  opacity: 0; transition: all .2s;
}
.hist-card .hc-del svg { width: 14px; height: 14px; }
.hist-card:hover .hc-del { opacity: 1; }
.hist-card .hc-del:hover { background: var(--danger); color: white; }
.hist-empty {
  grid-column: 1 / -1;
  padding: 60px 24px;
  text-align: center;
  color: var(--text-mute);
  background: var(--surface);
  border: 2px dashed var(--border-strong);
  border-radius: 18px;
}
.hist-empty svg { width: 48px; height: 48px; margin-bottom: 14px; opacity: .4; }

/* ================================================================
   ABOUT
   ================================================================ */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  max-width: 1100px;
}
.about-card {
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(12px);
}
.about-card h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem; font-weight: 600;
  margin-bottom: 8px;
  color: var(--accent);
}
.about-card p { font-size: .92rem; color: var(--text-soft); line-height: 1.6; }
.about-card strong { color: var(--text); }

/* ================================================================
   TOAST
   ================================================================ */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(120%);
  padding: 12px 22px;
  background: var(--primary);
  color: var(--bg);
  border-radius: 12px;
  font-size: .9rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  transition: transform .4s cubic-bezier(.22,1,.36,1);
  max-width: 90vw;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); color: white; }
.toast.error { background: var(--danger); color: white; }

/* ================================================================
   MODAL
   ================================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay.show { display: flex; animation: fadeIn .25s; }
.modal {
  background: var(--surface-solid);
  border-radius: 18px;
  padding: 32px;
  max-width: 420px; width: 100%;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.modal h3 { font-family: 'Fraunces', serif; font-size: 1.3rem; margin-bottom: 8px; }
.modal p { color: var(--text-soft); margin-bottom: 20px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ================================================================
   PRINT
   ================================================================ */
@media print {
  body { background: white !important; color: black !important; }
  .bg-layer, .sidebar, .menu-toggle, .no-print, .result-toolbar { display: none !important; }
  .main { margin-left: 0; padding: 0; }
  .view-result { display: block !important; }
  .lesson-plan {
    background: white !important; border: none !important;
    box-shadow: none !important; padding: 0 !important; max-width: 100% !important;
    backdrop-filter: none !important;
  }
  .lp-head, .lp-section h2 { color: black !important; }
  .lp-section h2::before { background: #444 !important; }
  .lp-info-grid { background: #f5f5f5 !important; border: 1px solid #ccc; }
  .lp-tag { background: #eee !important; color: black !important; border-color: #ccc !important; }
}

/* ================================================================
   RESPONSIVO
   ================================================================ */
@media (max-width: 980px) {
  .main { padding: 32px 28px 80px; }
  .lesson-plan { padding: 36px 28px; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-close { display: grid; place-items: center; }
  .menu-toggle { display: flex; }
  .main { margin-left: 0; padding: 80px 20px 40px; }
  .hero { padding-top: 8px; }
  .hero-title { font-size: 2.2rem; }
  .hero-stats { padding: 16px 18px; gap: 16px; }
  .stat-num { font-size: 1.5rem; }
  .lesson-plan { padding: 28px 22px; border-radius: 16px; }
  .lp-head { flex-direction: column; }
  .lp-head .lp-meta { text-align: left; }
  .lp-head h1 { font-size: 1.5rem; }
  .form-grid { grid-template-columns: 1fr; }
  .result-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-right { justify-content: space-between; }
  .toolbar-right .btn-ghost, .toolbar-right .btn-primary { flex: 1; justify-content: center; }
}

@media (max-width: 480px) {
  .hero-actions .btn-primary, .hero-actions .btn-ghost { flex: 1; justify-content: center; }
  .hero-stats { flex-direction: column; align-items: flex-start; }
  .stat-sep { width: 100%; height: 1px; }
  .lp-info-grid { grid-template-columns: 1fr 1fr; }
}


/* ============================================================
   RODAPÉ — Créditos de Autoria
   ============================================================ */

.site-footer {
  position: relative;
  margin-top: 80px;
  margin-left: var(--sidebar-w, 280px);
  padding: 48px 32px 32px;
  background: linear-gradient(180deg,
    rgba(15, 47, 56, 0.02) 0%,
    rgba(15, 47, 56, 0.06) 100%);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-top: 1px solid var(--border, rgba(15, 47, 56, 0.12));
  z-index: 5;
}

[data-theme="dark"] .site-footer {
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.02) 0%,
    rgba(255, 255, 255, 0.05) 100%);
  border-top-color: rgba(255, 255, 255, 0.08);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 40px;
  align-items: center;
}

/* Marca PlanoLab no rodapé */
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent, #d97706);
}

.footer-icon {
  width: 36px;
  height: 36px;
  animation: spin-slow 14s linear infinite;
}

@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

.footer-brand-text {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary, #0f2f38);
  letter-spacing: -0.02em;
}

.footer-brand-text em {
  font-style: italic;
  color: var(--accent, #d97706);
  font-weight: 500;
}

/* Bloco central: autor + titulação */
.footer-author {
  text-align: center;
}

.footer-copyright {
  font-family: 'Fraunces', serif;
  font-size: 1.05rem;
  margin: 0 0 4px;
  color: var(--text-primary, #0f2f38);
  letter-spacing: 0.01em;
}

.copy-symbol {
  font-size: 1.2rem;
  color: var(--accent, #d97706);
  font-weight: 500;
  margin-right: 2px;
}

.author-name {
  font-weight: 900;
  font-size: 1.15rem;
  background: linear-gradient(135deg,
    var(--text-primary, #0f2f38) 0%,
    var(--accent, #d97706) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-left: 4px;
}

.footer-title {
  font-family: 'Manrope', sans-serif;
  font-size: 0.88rem;
  color: var(--text-secondary, #5a6f78);
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Bloco direito: links */
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(15, 47, 56, 0.04);
  color: var(--text-primary, #0f2f38);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.footer-link:hover {
  background: var(--accent, #d97706);
  color: #fff;
  transform: translateX(-2px);
  border-color: var(--accent, #d97706);
}

.footer-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

[data-theme="dark"] .footer-link {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary, #f4efe6);
}

/* Bloco da Lei de Direitos — abaixo, linha cheia */
.footer-legal {
  grid-column: 1 / -1;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--border, rgba(15, 47, 56, 0.15));
  text-align: center;
}

.footer-legal p {
  font-family: 'Manrope', sans-serif;
  font-size: 0.78rem;
  color: var(--text-secondary, #5a6f78);
  margin: 0 0 4px;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.footer-legal strong {
  color: var(--accent, #d97706);
  font-weight: 700;
}

.footer-license {
  font-size: 0.75rem !important;
  opacity: 0.85;
}

/* Responsivo: mobile */
@media (max-width: 900px) {
  .site-footer {
    margin-left: 0;
    padding: 36px 20px 24px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }

  .footer-brand {
    justify-content: center;
  }

  .footer-links {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer-legal {
    margin-top: 16px;
  }
}

/* Impressão: rodapé não vai pro PDF */
@media print {
  .site-footer {
    display: none !important;
  }
}
