:root {
  /* Marca e Destaque (Regra 60-30-10) */
  --brand: #6b308b;
  --brand-hover: #5a2775;
  --brand-light: #f5eefa;
  --accent-cta: #16a34a;
  --accent-cta-hover: #15803d;

  /* Superfícies Light (60% bg, 30% surface) */
  --bg: #f8f7fa;
  --surface: #ffffff;
  --surface-hover: #faf9fc;
  --surface-elevated: #f3f0f8;
  --line: #e8e6ef;
  --line-strong: #d7d3e3;

  /* Tipografia Light */
  --text-main: #181524;
  --text-muted: #5f5a73;
  --text-subtle: #8e88a3;

  /* Semânticas */
  --success: #1faa59;
  --success-bg: #e8f7ee;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --info: #2563eb;
  --info-bg: #eff6ff;

  /* Sombras Multicamadas Suaves */
  --shadow-sm: 0 1px 2px rgba(20, 16, 30, 0.04);
  --shadow-md: 0 4px 16px rgba(20, 16, 30, 0.06);
  --shadow-lg: 0 12px 40px rgba(20, 16, 30, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

[data-theme="dark"] {
  /* Superfícies Dark (Roxo Profundo / Slate - NUNCA preto absoluto) */
  --bg: #0d0b13;
  --surface: #161320;
  --surface-hover: #1f1b2c;
  --surface-elevated: #211c30;
  --line: #272136;
  --line-strong: #38304d;

  --brand: #9d5ce5;
  --brand-hover: #b075f0;
  --brand-light: #261938;

  /* Tipografia Dark */
  --text-main: #f5f3f9;
  --text-muted: #aba5be;
  --text-subtle: #756e87;

  /* Semânticas no Dark */
  --success-bg: #0d281a;
  --warning-bg: #3b2308;
  --danger-bg: #451016;
  --info-bg: #0c2847;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
  transition: background-color 0.25s ease, color 0.2s ease;
  min-height: 100vh;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}

/* Barra Superior de Navegação do Projeto (Acima da Dobra) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: 10px 20px;
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--text-main);
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6b308b, #9d5ce5);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-sm);
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-hover);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1), background-color 0.15s ease, color 0.15s ease;
}

.tab-btn:hover {
  transform: translateY(-1px);
  color: var(--text-main);
  border-color: var(--line-strong);
}

.tab-btn.active {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.theme-toggle {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-hover);
  color: var(--text-main);
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
}

/* Containers */
.main-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.quiz-shell {
  max-width: 640px;
  margin: 0 auto;
}

/* Chips & Badges */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.chip-hot { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(220, 38, 38, 0.25); }
.chip-warm { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(217, 119, 6, 0.25); }
.chip-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(31, 170, 89, 0.25); }
.chip-brand { background: var(--brand-light); color: var(--brand); border: 1px solid rgba(107, 48, 139, 0.25); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

/* Progress Bar do Quiz */
.progress-header {
  margin-bottom: 20px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: var(--surface-elevated);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #1faa59);
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.2, 0, 0, 1);
}

/* Botões e Opções do Quiz (Touch Targets >= 48px) */
.quiz-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 8px;
  color: var(--text-main);
}

.quiz-subtitle {
  font-size: 14.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  width: 100%;
  min-height: 58px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 2px solid var(--line);
  background: var(--surface-hover);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1), border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.option-btn:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  background: var(--brand-light);
  box-shadow: var(--shadow-sm);
}

.option-btn:active {
  transform: translateY(1px) scale(0.99);
}

.option-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.option-emoji {
  font-size: 22px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.option-arrow {
  color: var(--brand);
  font-weight: 800;
  font-size: 18px;
}

/* Botões Primários (CTA) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  border: none;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1), background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.98); }

.btn-cta {
  width: 100%;
  background: linear-gradient(135deg, #16a34a, #1faa59);
  color: #ffffff;
  font-size: 18px;
  padding: 16px 24px;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.3);
}

.btn-cta:hover {
  background: linear-gradient(135deg, #15803d, #16a34a);
}

.btn-brand {
  background: var(--brand);
  color: #ffffff;
}

.btn-outline {
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--line-strong);
}

/* Order Bump Cards (Alta Conversão) */
.bump-section {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bump-card {
  border: 2px dashed #d97706;
  background: var(--warning-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.bump-card.selected {
  border: 2px solid var(--success);
  background: var(--success-bg);
  box-shadow: var(--shadow-sm);
}

.bump-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.bump-checkbox {
  width: 24px;
  height: 24px;
  accent-color: var(--success);
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.bump-title {
  font-weight: 800;
  font-size: 15px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.bump-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.bump-price-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--success);
  background: var(--surface);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.old-price {
  text-decoration: line-through;
  color: var(--text-subtle);
  font-weight: 500;
}

/* Resumo do Pedido Dinâmico */
.order-summary {
  background: var(--surface-elevated);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 20px 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

.summary-row.total {
  border-top: 1px solid var(--line-strong);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

/* Grid de Painel e Apostilas */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  margin: 6px 0 4px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.input-group label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.input-field {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface-hover);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
}

/* Folha de Atividade Imprimível */
.worksheet-preview {
  background: #ffffff;
  color: #181524;
  border: 2px solid #d7d3e3;
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 16px;
}

.worksheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.worksheet-item {
  border: 2px dashed #8e88a3;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--text-main);
  color: var(--surface);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media print {
  .topbar, .no-print {
    display: none !important;
  }
  body {
    background: #ffffff;
    color: #000000;
  }
  .worksheet-preview {
    border: none;
    box-shadow: none;
    padding: 0;
  }
}

/* Ocultar qualquer selo externo / Powered by Netlify */
#nl-badge-frame,
#nl-hud-frame,
iframe#nl-badge-frame,
iframe#nl-hud-frame,
iframe[title="Powered by Netlify"],
iframe[title="Netlify"],
a[href*="netlify.com"],
iframe[src*="netlify"],
div[class*="netlify"],
div[id*="netlify"],
netlify-badge {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  pointer-events: none !important;
}
