/* ============================================================
   GUIA DEFINITIVO DE RESSEGUROS — Design System Fintech Institucional
   Plataforma de estudos mobile-first, dark mode
   ============================================================ */

/* --- Google Fonts: IBM Plex Sans (Financeiro/Institucional) --- */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ============================================================
   1. DESIGN TOKENS (Custom Properties)
   ============================================================ */
:root {
  /* Cores primárias — Background escuro institucional */
  --bg-primary: #0F172A;
  --bg-secondary: #1E293B;
  --bg-card: #1E293B;
  --bg-card-hover: #273548;
  --bg-elevated: #334155;

  /* Acentos — Paleta Amber/Gold Institucional (confiança financeira) */
  --accent-primary: #F59E0B;
  --accent-primary-dim: rgba(245, 158, 11, 0.12);
  --accent-secondary: #3B82F6;
  --accent-secondary-dim: rgba(59, 130, 246, 0.12);
  --accent-tertiary: #8B5CF6;
  --accent-tertiary-dim: rgba(139, 92, 246, 0.12);
  --accent-green: #10B981;
  --accent-green-dim: rgba(16, 185, 129, 0.12);
  --accent-red: #EF4444;
  --accent-red-dim: rgba(239, 68, 68, 0.12);
  --accent-yellow: #FBBF24;
  --accent-yellow-dim: rgba(251, 191, 36, 0.12);

  /* Texto — Alto contraste, legível */
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-tertiary: #64748B;
  --text-inverse: #0F172A;

  /* Bordas */
  --border-color: rgba(148, 163, 184, 0.15);
  --border-light: rgba(148, 163, 184, 0.08);

  /* Sombras — sem glows neon, mais sóbrio */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow-cyan: 0 0 16px rgba(245, 158, 11, 0.15);
  --shadow-glow-orange: 0 0 16px rgba(59, 130, 246, 0.15);

  /* Tipografia — IBM Plex Sans: financeira, confiável, institucional */
  --font-primary: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Fira Code', monospace;

  /* Tamanhos de fonte — escala mobile-first */
  --fs-xs: 0.75rem;      /* 12px */
  --fs-sm: 0.8125rem;     /* 13px */
  --fs-base: 0.9375rem;   /* 15px */
  --fs-md: 1.0625rem;     /* 17px */
  --fs-lg: 1.25rem;       /* 20px */
  --fs-xl: 1.5rem;        /* 24px */
  --fs-2xl: 2rem;         /* 32px */
  --fs-3xl: 2.5rem;       /* 40px */
  --fs-hero: 2.75rem;     /* 44px */

  /* Espaçamento */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Bordas */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transições */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --max-width: 720px;
  --header-height: 56px;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  font-family: var(--font-primary);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Scrollbar customizada */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* Seleção de texto */
::selection {
  background: var(--accent-primary);
  color: var(--text-inverse);
}

/* Focus states visíveis para acessibilidade */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Links */
a {
  color: var(--accent-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: #60A5FA;
}

/* ============================================================
   3. HEADER & NAVEGAÇÃO
   ============================================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(10, 14, 20, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.header__logo-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent-primary), #D97706);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* Barra de progresso de leitura */
.progress-bar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  width: 0%;
  z-index: 999;
  transition: width 100ms linear;
}

/* Menu hamburger (mobile) */
.header__menu-btn {
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}
.header__menu-btn:hover {
  background: var(--bg-card);
}
.header__menu-btn svg {
  width: 24px;
  height: 24px;
}

/* Sidebar de navegação */
.sidebar {
  position: fixed;
  top: 0;
  left: -100%;
  width: 85%;
  max-width: 320px;
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  z-index: 2000;
  transition: left var(--transition-slow);
  overflow-y: auto;
  padding: var(--space-xl) var(--space-md);
}
.sidebar.open {
  left: 0;
}

.sidebar__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}
.sidebar__overlay.visible {
  opacity: 1;
  visibility: visible;
}

.sidebar__title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-lg);
}

.sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--fs-base);
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  min-height: 48px;
  /* Área de toque ampla */
  -webkit-tap-highlight-color: transparent;
}
.sidebar__nav-item:hover,
.sidebar__nav-item.active {
  background: var(--bg-card);
  color: var(--text-primary);
}
.sidebar__nav-item.active {
  border-left: 3px solid var(--accent-primary);
}
.sidebar__nav-item .nav-icon {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
  color: var(--accent-primary);
}
.sidebar__nav-item .nav-badge {
  margin-left: auto;
  background: var(--accent-primary-dim);
  color: var(--accent-primary);
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* ============================================================
   4. LAYOUT PRINCIPAL
   ============================================================ */
.main {
  padding-top: calc(var(--header-height) + 8px);
  min-height: 100vh;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Seções (Módulos) */
.module {
  padding: var(--space-2xl) 0;
  border-bottom: 1px solid var(--border-light);
}
.module:last-child {
  border-bottom: none;
}

/* ============================================================
   5. HERO SECTION
   ============================================================ */
.hero {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  position: relative;
  overflow: hidden;
}

/* Padrão geométrico sutil de fundo */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245, 158, 11, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 158, 11, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* Gradiente de fundo refinado */
.hero::after {
  content: '';
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(ellipse, rgba(245, 158, 11, 0.06) 0%, rgba(59, 130, 246, 0.03) 40%, transparent 70%);
  pointer-events: none;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--accent-primary-dim);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-full);
  color: var(--accent-primary);
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: var(--space-xl);
  position: relative;
  z-index: 1;
}
.hero__badge .pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

.hero__title {
  font-size: var(--fs-2xl);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-md);
  position: relative;
  z-index: 1;
}
.hero__title .highlight {
  background: linear-gradient(135deg, var(--accent-primary), #FBBF24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto var(--space-xl);
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

/* KPI cards do hero */
.hero__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  width: 100%;
  max-width: 400px;
  margin-bottom: var(--space-xl);
  position: relative;
  z-index: 1;
}

.hero__stat {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.hero__stat:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
}
.hero__stat-value {
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--accent-primary);
  display: block;
}
.hero__stat-label {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* CTA do hero */
.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  background: var(--accent-primary);
  color: var(--text-inverse);
  font-weight: 700;
  font-size: var(--fs-base);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  min-height: 52px;
  position: relative;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
}
.hero__cta:hover {
  transform: translateY(-1px);
  background: #D97706;
  box-shadow: var(--shadow-md);
  color: var(--text-inverse);
}

/* ============================================================
   6. TÍTULOS DE MÓDULO
   ============================================================ */
.module__header {
  margin-bottom: var(--space-xl);
}

.module__number {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-primary);
  margin-bottom: var(--space-sm);
}
.module__number::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 2px;
  background: var(--accent-primary);
}

.module__title {
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}

.module__description {
  font-size: var(--fs-base);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================================
   7. CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: all var(--transition-base);
}
.card:hover {
  border-color: rgba(245, 158, 11, 0.2);
  background: var(--bg-card-hover);
}

.card--interactive {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.card--interactive:active {
  transform: scale(0.98);
}

/* Card com ícone lateral */
.card--icon {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}
.card__icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4em;
}
.card__icon--cyan { background: var(--accent-primary-dim); }
.card__icon--orange { background: var(--accent-secondary-dim); }
.card__icon--purple { background: var(--accent-tertiary-dim); }
.card__icon--green { background: var(--accent-green-dim); }
.card__icon--red { background: var(--accent-red-dim); }

.card__title {
  font-size: var(--fs-md);
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.card__text {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Cards empilhados */
.card-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Card de métrica / resultado */
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
}
.metric-card__value {
  font-size: var(--fs-xl);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.metric-card__label {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}
.metric-card--cyan .metric-card__value { color: var(--accent-primary); }
.metric-card--orange .metric-card__value { color: var(--accent-secondary); }
.metric-card--green .metric-card__value { color: var(--accent-green); }
.metric-card--red .metric-card__value { color: var(--accent-red); }
.metric-card--purple .metric-card__value { color: var(--accent-tertiary); }

/* Grid de métricas */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

/* ============================================================
   8. ACCORDIONS (Conteúdo expandível)
   ============================================================ */
.accordion {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-sm);
  background: var(--bg-card);
}

.accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
  min-height: 56px;
  text-align: left;
  gap: var(--space-md);
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition-fast);
}
.accordion__trigger:hover {
  background: var(--bg-card-hover);
}

.accordion__trigger-icon {
  flex-shrink: 0;
  font-size: 1.2em;
  width: 32px;
  text-align: center;
}

.accordion__trigger-text {
  flex: 1;
}

.accordion__chevron {
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  transition: transform var(--transition-base);
  flex-shrink: 0;
}
.accordion.open .accordion__chevron {
  transform: rotate(180deg);
}

.accordion__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}
.accordion.open .accordion__content {
  max-height: 5000px;
}

.accordion__body {
  padding: 0 var(--space-lg) var(--space-lg);
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: var(--fs-base);
}
.accordion__body p {
  margin-bottom: var(--space-md);
}
.accordion__body strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============================================================
   9. CALCULADORAS (Sliders + Inputs)
   ============================================================ */
.calculator {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.calculator__title {
  font-size: var(--fs-lg);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.calculator__subtitle {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

/* Input group */
.input-group {
  margin-bottom: var(--space-lg);
}
.input-group__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}
.input-group__value {
  color: var(--accent-primary);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-md);
}

/* Slider customizado */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  outline: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: grab;
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
  transition: transform var(--transition-fast);
}
.slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.15);
}
.slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: grab;
  border: 3px solid var(--bg-primary);
}

/* Input numérico */
.input-number {
  width: 100%;
  padding: var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--fs-base);
  font-weight: 500;
  outline: none;
  min-height: 48px;
  transition: border-color var(--transition-fast);
}
.input-number:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-dim);
}
.input-number::placeholder {
  color: var(--text-tertiary);
}

/* Resultado da calculadora */
.calc-result {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
  border: 1px solid var(--border-color);
}
.calc-result__title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

/* Container de gráfico */
.chart-container {
  position: relative;
  width: 100%;
  max-height: 280px;
  margin: var(--space-md) 0;
}

/* ============================================================
   10. CODE BLOCKS (Syntax Highlighting)
   ============================================================ */
.code-block {
  position: relative;
  background: #0D1117;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin: var(--space-md) 0;
  overflow: hidden;
}

.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
}

.code-block__lang {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.code-block__copy {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  font-family: var(--font-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 32px;
  -webkit-tap-highlight-color: transparent;
}
.code-block__copy:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.code-block__copy.copied {
  color: var(--accent-green);
  border-color: var(--accent-green);
}

.code-block__body {
  padding: var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.code-block__body pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: #E6EDF3;
  white-space: pre;
  tab-size: 4;
}

/* Syntax highlighting tokens */
.token-keyword { color: #FF7B72; }
.token-string { color: #A5D6FF; }
.token-comment { color: #8B949E; font-style: italic; }
.token-function { color: #D2A8FF; }
.token-number { color: #79C0FF; }
.token-operator { color: #FF7B72; }
.token-variable { color: #FFA657; }
.token-class { color: #7EE787; }

/* ============================================================
   11. TABELAS RESPONSIVAS
   ============================================================ */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-md) 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

/* Indicador de scroll horizontal */
.table-responsive::after {
  content: '← Deslize →';
  display: block;
  text-align: center;
  padding: var(--space-sm);
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.table th {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
}
.table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}
.table tr:hover td {
  background: var(--bg-card);
}
.table tr:last-child td {
  border-bottom: none;
}

/* ============================================================
   12. BADGES & TAGS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge--cyan { background: var(--accent-primary-dim); color: var(--accent-primary); }
.badge--orange { background: var(--accent-secondary-dim); color: var(--accent-secondary); }
.badge--purple { background: var(--accent-tertiary-dim); color: var(--accent-tertiary); }
.badge--green { background: var(--accent-green-dim); color: var(--accent-green); }
.badge--red { background: var(--accent-red-dim); color: var(--accent-red); }
.badge--yellow { background: var(--accent-yellow-dim); color: var(--accent-yellow); }

/* Nível de dificuldade */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  font-weight: 600;
}
.level-badge--beginner { color: var(--accent-green); }
.level-badge--intermediate { color: var(--accent-yellow); }
.level-badge--advanced { color: var(--accent-red); }

/* ============================================================
   13. TOOLTIPS (Termos técnicos)
   ============================================================ */
.term {
  color: var(--accent-primary);
  border-bottom: 1px dashed var(--accent-primary);
  cursor: help;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.tooltip {
  position: fixed;
  max-width: 300px;
  padding: var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--text-primary);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}
.tooltip__title {
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 4px;
  font-size: var(--fs-base);
}
.tooltip__text {
  color: var(--text-secondary);
}

/* ============================================================
   14. DIAGRAMA / FLUXO VISUAL
   ============================================================ */
.flow {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin: var(--space-lg) 0;
}

.flow__step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent-primary);
}
.flow__step:nth-child(even) {
  border-left-color: var(--accent-tertiary);
}

.flow__step-number {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: var(--accent-primary-dim);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--fs-sm);
}

.flow__step-content {
  flex: 1;
}
.flow__step-title {
  font-weight: 700;
  font-size: var(--fs-base);
  margin-bottom: 2px;
}
.flow__step-desc {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.flow__connector {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 0 22px;
  color: var(--text-tertiary);
  font-size: 1.2em;
}

/* ============================================================
   15. SOA (Statement of Account) Visual
   ============================================================ */
.soa {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--space-lg) 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}

.soa__header {
  background: var(--bg-elevated);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}
.soa__header-title {
  font-weight: 700;
  color: var(--accent-primary);
  font-family: var(--font-primary);
}
.soa__header-sub {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  font-family: var(--font-primary);
}

.soa__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
  min-height: 44px;
  cursor: pointer;
}
.soa__row:hover {
  background: var(--bg-card-hover);
}
.soa__row--total {
  background: var(--bg-elevated);
  font-weight: 700;
  border-top: 2px solid var(--border-color);
}
.soa__row--positive .soa__amount { color: var(--accent-green); }
.soa__row--negative .soa__amount { color: var(--accent-red); }

.soa__label {
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: var(--fs-sm);
}
.soa__operator {
  color: var(--text-tertiary);
  width: 24px;
  text-align: center;
}
.soa__amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   16. SEÇÃO DE GLOSSÁRIO — Busca e Filtro
   ============================================================ */
.glossary-search {
  position: relative;
  margin-bottom: var(--space-lg);
}
.glossary-search__input {
  width: 100%;
  padding: var(--space-md) var(--space-md) var(--space-md) 44px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: var(--fs-base);
  outline: none;
  min-height: 52px;
  transition: border-color var(--transition-fast);
}
.glossary-search__input:focus {
  border-color: var(--accent-primary);
}
.glossary-search__icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
}

.glossary-filters {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-lg);
  -webkit-overflow-scrolling: touch;
}
.glossary-filter {
  flex-shrink: 0;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 40px;
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}
.glossary-filter.active,
.glossary-filter:hover {
  background: var(--accent-primary-dim);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ============================================================
   17. CARDS DIDÁTICOS DO GLOSSÁRIO INTELIGENTE
   ============================================================ */
.didactic-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  animation: cardIn 0.4s ease;
}
.didactic-card:hover {
  border-color: rgba(245, 158, 11, 0.2);
  box-shadow: var(--shadow-md);
}
.didactic-card--highlight {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.08);
}
.didactic-card--highlight .didactic-card__header {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(59, 130, 246, 0.05));
}

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

/* Header do card */
.didactic-card__header {
  padding: var(--space-lg);
  background: var(--bg-card-hover);
  border-bottom: 1px solid var(--border-light);
}
.didactic-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-sm);
}
.didactic-card__title {
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text-primary);
}

/* Seções do card (Técnica, Analogia, Exemplo) */
.didactic-card__section {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}
.didactic-card__section:last-child {
  border-bottom: none;
}

.didactic-card__section-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
}
.didactic-card__section--tecnica .didactic-card__section-label {
  color: var(--accent-primary);
}
.didactic-card__section--analogia .didactic-card__section-label {
  color: var(--accent-yellow);
}
.didactic-card__section--exemplo .didactic-card__section-label {
  color: var(--accent-green);
}
.didactic-card__section--analogia {
  background: rgba(251, 191, 36, 0.03);
}
.didactic-card__section--exemplo {
  background: rgba(16, 185, 129, 0.03);
}
.didactic-card__section-text {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.8;
}
.didactic-card__section-text strong {
  color: var(--text-primary);
}

/* Estado vazio (nenhum resultado) */
.glossary-empty {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--text-tertiary);
}
.glossary-empty__icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.6;
}
.glossary-empty__text {
  font-size: var(--fs-md);
  font-weight: 500;
}

/* ============================================================
   18. ANIMAÇÕES DE SCROLL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Delays escalonados para cards */
.stagger > *:nth-child(1) { transition-delay: 0ms; }
.stagger > *:nth-child(2) { transition-delay: 80ms; }
.stagger > *:nth-child(3) { transition-delay: 160ms; }
.stagger > *:nth-child(4) { transition-delay: 240ms; }
.stagger > *:nth-child(5) { transition-delay: 320ms; }
.stagger > *:nth-child(6) { transition-delay: 400ms; }

/* ============================================================
   18. GAUGE CHART (Stop Loss)
   ============================================================ */
.gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: var(--space-lg) 0;
}
.gauge-value {
  font-size: var(--fs-2xl);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  margin-top: var(--space-sm);
}
.gauge-label {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.gauge-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.gauge-status--safe {
  background: var(--accent-green-dim);
  color: var(--accent-green);
}
.gauge-status--danger {
  background: var(--accent-red-dim);
  color: var(--accent-red);
}

/* ============================================================
   19. TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  flex: 1;
  min-width: 80px;
  padding: var(--space-sm) var(--space-md);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  min-height: 44px;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.tab.active {
  background: var(--bg-card);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* ============================================================
   20. CALLOUTS / ALERTAS DIDÁTICOS
   ============================================================ */
.callout {
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-md) 0;
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.callout__icon {
  font-size: 1.3em;
  flex-shrink: 0;
  margin-top: 2px;
}
.callout--info {
  background: var(--accent-primary-dim);
  border-left: 3px solid var(--accent-primary);
  color: var(--text-primary);
}
.callout--warning {
  background: var(--accent-yellow-dim);
  border-left: 3px solid var(--accent-yellow);
}
.callout--tip {
  background: var(--accent-green-dim);
  border-left: 3px solid var(--accent-green);
}
.callout--danger {
  background: var(--accent-red-dim);
  border-left: 3px solid var(--accent-red);
}

/* ============================================================
   21. SEPARADOR
   ============================================================ */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-xl) 0;
}

/* ============================================================
   22. FOOTER
   ============================================================ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--space-2xl) var(--space-md);
  text-align: center;
}
.footer__text {
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
}
.footer__text a {
  color: var(--accent-primary);
}

/* ============================================================
   23. RESPONSIVO — BREAKPOINTS
   ============================================================ */

/* Tablet (640px+) */
@media (min-width: 640px) {
  :root {
    --fs-hero: 3.5rem;
    --fs-2xl: 2.5rem;
  }

  .hero__stats {
    grid-template-columns: repeat(4, 1fr);
    max-width: 560px;
  }

  .metric-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .table-responsive::after {
    display: none;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  :root {
    --max-width: 860px;
    --fs-hero: 4rem;
    --fs-2xl: 3rem;
  }

  .sidebar {
    display: none;
  }
  .header__menu-btn {
    display: none;
  }

  /* Desktop nav inline */
  .header__nav {
    display: flex;
    gap: var(--space-sm);
  }
  .header__nav-link {
    padding: var(--space-sm) var(--space-md);
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
  }
  .header__nav-link:hover,
  .header__nav-link.active {
    color: var(--text-primary);
    background: var(--bg-card);
  }
}

/* Mobile pequeno (< 380px) */
@media (max-width: 379px) {
  :root {
    --fs-2xl: 1.75rem;
    --fs-xl: 1.25rem;
  }
  .hero__stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }
}

/* ============================================================
   24. UTILITÁRIOS
   ============================================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
