/* MENTOR IA — Design Tokens
   Mobile-first. Aluno-first. Não usar valores arbitrários — sempre usar tokens.
   Versão: 1.0 (2026-04-30) */

:root {
  /* ===== Cores neutras (white-first) ===== */
  --color-bg: #ffffff;
  --color-bg-soft: #f9fafb;
  --color-bg-mute: #f3f4f6;
  --color-bg-elev: #ffffff; /* card sobre soft */

  --color-text: #0f172a;        /* near-black */
  --color-text-soft: #475569;
  --color-text-mute: #94a3b8;
  --color-text-invert: #ffffff;

  --color-border: #e5e7eb;
  --color-border-strong: #d1d5db;
  --color-border-focus: #2563eb;

  /* ===== Marca ===== */
  --color-brand: #2563eb;        /* primário — azul confiança */
  --color-brand-hover: #1d4ed8;
  --color-brand-soft: #dbeafe;   /* fundo de badges, hover sutil */
  --color-brand-on: #ffffff;

  /* ===== Semânticas ===== */
  --color-success: #059669;
  --color-success-soft: #d1fae5;
  --color-danger: #dc2626;
  --color-danger-soft: #fee2e2;
  --color-warning: #d97706;
  --color-warning-soft: #fef3c7;
  --color-info: #0284c7;
  --color-info-soft: #e0f2fe;

  /* ===== Acentos celebrativos (gamificação) ===== */
  --color-xp: #f59e0b;            /* dourado — XP, conquistas */
  --color-streak: #ef4444;        /* fogo — streak */
  --color-league-bronze: #b45309;
  --color-league-silver: #6b7280;
  --color-league-gold: #ca8a04;
  --color-league-diamond: #0891b2;

  /* ===== Tipografia ===== */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, Consolas, "Liberation Mono", monospace;

  /* Mobile-first: corpo 16px (evita zoom no iOS) */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 36px;
  --text-4xl: 48px;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --leading-tight: 1.2;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* ===== Espaçamento (4px grid) ===== */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* ===== Radius ===== */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  /* ===== Sombras (suaves, modernas) ===== */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.10), 0 4px 6px -2px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.10), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
  --shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.20);
  --shadow-focus-danger: 0 0 0 3px rgba(220, 38, 38, 0.20);

  /* ===== Animação ===== */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-base: 220ms;
  --duration-slow: 320ms;

  /* ===== Layout ===== */
  --header-height: 56px;
  --bottom-nav-height: 64px;     /* mobile bottom nav */
  --sidebar-width: 256px;        /* desktop */
  --container-max: 1200px;
  --container-narrow: 720px;
  --content-max: 64ch;           /* leitura confortável */

  /* ===== Z-index escala ===== */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 800;
  --z-modal: 900;
  --z-toast: 1000;
  --z-tooltip: 1100;

  /* ===== Tamanhos de toque (mobile) ===== */
  --touch-min: 44px;             /* Apple HIG */
}

/* ===== Dark mode (preparado, não ativado por padrão) ===== */
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --color-bg: #0f172a;
    --color-bg-soft: #1e293b;
    --color-bg-mute: #334155;
    --color-bg-elev: #1e293b;
    --color-text: #f8fafc;
    --color-text-soft: #cbd5e1;
    --color-text-mute: #64748b;
    --color-border: #334155;
    --color-border-strong: #475569;
    --color-brand-soft: #1e3a8a;
  }
}

/* ===== Reset minimalista ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }
a { color: var(--color-brand); text-decoration: none; }
a:hover { color: var(--color-brand-hover); }
:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); }

/* Scrollbar mais clean (desktop) */
@media (hover: hover) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: var(--radius-pill); }
  ::-webkit-scrollbar-thumb:hover { background: var(--color-text-mute); }
}

/* Reduzir motion respeitando preferência do usuário */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
