/*
 * 01-tokens.css — design tokens
 * ---------------------------------------------------------------------------
 * The ONLY file where raw colour values belong. Everything else references
 * var(--aura-*). Values marked "spec" come from Tema: Claro.pdf.
 *
 * Load order: 01-tokens → 02-base → 03-layout → 04-components → 05-prose
 *             → 06-utilities → 07-corrections
 * ---------------------------------------------------------------------------
 */

:root {
  /* ── Brand (spec) ──────────────────────────────────────────────────────── */
  --aura-primary:        #6027CF;   /* Principal (Destaque) */
  --aura-primary-soft:   #8A6AC8;   /* Principal 2 */
  --aura-primary-fg:     #ffffff;
  --aura-gradient:       linear-gradient(135deg, #6027CF 0%, #8A6AC8 100%);

  /* Yellow from the official gentrop lockup. Brand accent — deliberately kept
     separate from --aura-warning, which is the semantic "Aviso" colour. */
  --aura-brand-yellow:   #FFD11F;

  /* ── Semantic (spec) ───────────────────────────────────────────────────── */
  --aura-success:        #00BE30;   /* Sucesso */
  --aura-warning:        #F3BD0A;   /* Aviso */
  --aura-danger:         #DC2626;

  /* ── Text (spec) ───────────────────────────────────────────────────────── */
  --aura-text:           #212529;   /* Texto — was missing; views fell back to #111827 */
  --aura-text-muted:     #5a6167;   /* Texto Secundário */
  --aura-text-subtle:    #9CA3AF;

  /* ── Surfaces ──────────────────────────────────────────────────────────── */
  --aura-content-bg:     #ffffff;   /* Background (spec) */
  --aura-content-border: #E8E6F0;
  --aura-canvas:         #FAFAFC;   /* page behind cards */
  --aura-sidebar-width:  288px;

  /* ── Sidebar chrome — DARK (applied) ─────────────────────────────────────
   * The sidebar is dark while the content area stays white. A dark chrome
   * recedes: it lowers total screen luminance and stops the navigation
   * competing with content for attention, which suits a reading app.
   *
   * HARD CONSTRAINT: --aura-primary (#6027CF) is only 2.33:1 on this ground
   * and CANNOT be used here. Even --aura-primary-soft (#8A6AC8) is 4.30:1.
   * Anything that needs to read as an accent inside the sidebar must use
   * --aura-sidebar-accent (8.6:1).
   *
   * Chosen for low chroma (0.04) rather than a saturated dark purple: violet is
   * short-wavelength, so large saturated violet fields never resolve crisply and
   * leave an afterimage when the eye moves to the white content.
   */
  --aura-sidebar-bg:      #17141F;   /* violet-biased near-black, not pure black */
  --aura-sidebar-raise:   #1F1B2B;   /* cards sitting on the chrome */
  --aura-sidebar-border:  #2B2637;
  --aura-sidebar-fg:      #EDEAF4;   /* body text, 15.3:1 — off-white, not pure white */
  --aura-sidebar-muted:   #9A93A8;   /* section labels, 6.2:1 */
  --aura-sidebar-accent:  #C0A6F0;   /* active state, 8.6:1 */
  --aura-sidebar-active:  #262430;   /* active row background */
  --aura-sidebar-hover:   rgba(255, 255, 255, 0.06);

  /* Level badges on the dark chrome — translucent fills with light text.
     The light-theme badge colours (e.g. #92400E on pale amber) are unreadable here. */
  --aura-sidebar-badge-admin-bg:   rgba(255, 209, 31, 0.18);
  --aura-sidebar-badge-admin-fg:   #FFD11F;
  --aura-sidebar-badge-gestor-bg:  rgba(243, 189, 10, 0.16);
  --aura-sidebar-badge-gestor-fg:  #F3BD0A;
  --aura-sidebar-badge-aluno-bg:   rgba(0, 190, 48, 0.16);
  --aura-sidebar-badge-aluno-fg:   #5CE07E;

  /* Form controls. #E5E7EB (Tailwind gray-200) failed the 3:1 non-text
     contrast requirement at 1.24:1 — see 07-corrections.css. */
  --aura-field-border:   #C9CDD4;
  --aura-field-bg:       #ffffff;

  /* ── Badges ────────────────────────────────────────────────────────────── */
  --aura-badge-admin-bg:   rgba(243, 189, 10, 0.15);
  --aura-badge-admin-text: #92400E;

  /* ── Shape & depth ─────────────────────────────────────────────────────── */
  --aura-radius-sm:      0.5rem;
  --aura-radius:         0.75rem;
  --aura-radius-lg:      1rem;
  --aura-radius-full:    9999px;
  --aura-shadow-sm:      0 1px 2px rgba(33, 37, 41, 0.05);
  --aura-shadow:         0 1px 3px rgba(33, 37, 41, 0.08), 0 8px 24px -12px rgba(33, 37, 41, 0.10);
  --aura-shadow-lg:      0 20px 45px -18px rgba(33, 37, 41, 0.28);

  /* ── Motion ────────────────────────────────────────────────────────────── */
  --aura-ease:           cubic-bezier(0.4, 0, 0.2, 1);
  --aura-duration:       150ms;

  /* ── Type ──────────────────────────────────────────────────────────────── */
  --aura-font-sans:      'Source Sans 3', 'Source Sans Pro', ui-sans-serif, system-ui, sans-serif;
  --aura-font-display:   'Space Grotesk', system-ui, sans-serif;
  --aura-font-mono:      ui-monospace, 'Cascadia Code', Consolas, monospace;

  /* Reading measure for long-form lesson content. 640px at 17px lands ~75
     characters per line; the previous max-w-4xl at 15px was ~119. */
  --aura-measure:        640px;
}

/*
 * ── Dark chrome aliases ──────────────────────────────────────
 * The sidebar tokens above are the live values. These aliases exist because the
 * same palette applies to any dark surface, and because docs/09-designer-brief.md
 * refers to them by these names.
 *
 * NOTE: INFERRED from the light spec and checked against WCAG — not designer
 * supplied. See the brief for the confirmation request.
 */
:root {
  --aura-chrome-bg:       var(--aura-sidebar-bg);
  --aura-chrome-raise:    var(--aura-sidebar-raise);
  --aura-chrome-fg:       var(--aura-sidebar-fg);
  --aura-chrome-muted:    var(--aura-sidebar-muted);
  --aura-chrome-accent:   var(--aura-sidebar-accent);
  --aura-chrome-border:   var(--aura-sidebar-border);
  --aura-primary-on-dark: var(--aura-sidebar-accent);
}
