/* Prova Endurance, the design system. THE SOURCE.

   This is the only file in the repo where a colour, a radius, a spacing step, a
   font stack or a type size is written down. Every surface references it
   directly; none keeps a copy:

     web-app       src/styles/global.css      @import, then ./tailwind.css
     web-landing   src/styles/global.css      @import, then ./tailwind.css
     Coach.Api     Coach.Api.csproj           linked into wwwroot/design-system/

   tailwind.css, next to this file, is the Tailwind 4 wiring both apps share: it
   turns these names into utilities and holds no value. Change a value here and
   all three surfaces pick it up on their next build. A NEW token also needs a line
   in tailwind.css. Rules: docs/10-design-system.md. Decision:
   docs/adr/0009-prova-visual-system.md.

   Colour names are shadcn's where shadcn has one (background, card, primary,
   muted-foreground, ring, ...), so a shadcn component reads this file with no
   translation layer. Names shadcn does not have (the status colours, the zones,
   the chart colours, subtle-foreground, the primary variants) are this system's
   own. Font, radius and shadow tokens carry a `ds-` prefix because Tailwind 4
   owns the plain names (--font-*, --radius-*, --shadow-*) for its theme.

   Dark is the default and sits on :root. The class .light on <html> switches.
   Colours are complete values (hsl(...)); translucency is color-mix(), which is
   what Tailwind 4 emits for bg-primary/40.

   The usage notes are the designer's, carried over from the Claude Design
   artifact this system was drawn in, with token names updated to the ones below.
   That artifact is a sketchpad now: a redesign made there lands by replacing
   values in THIS file, and nothing flows back. */

:root {
  /* Font stacks. */
  --ds-font-display: "Archivo Variable", "Archivo", ui-sans-serif, system-ui, sans-serif;
  --ds-font-body: "Archivo Variable", "Archivo", ui-sans-serif, system-ui, sans-serif;
  --ds-font-mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Radius. Curvas curtas. O sistema é instrumento, não bolha. */
  --ds-radius-xs: 2px; /* Barra de gráfico, faixa de zona, tag minúscula. */
  --ds-radius-sm: 4px; /* Input, select, checkbox, badge. */
  --ds-radius-md: 8px; /* Botão, chip, célula destacada. */
  --ds-radius-lg: 12px; /* Card, painel, popover. */
  --ds-radius-xl: 20px; /* Bloco do hero, modal grande, imagem de seção. */
  --ds-radius-pill: 999px; /* Pílula de filtro, avatar, indicador de zona redondo. */

  /* Spacing. Grade de 4px. Todo espaço vertical e horizontal sai desta escala. */
  --space-0\.5: 2px; /* Folga ótica entre ícone e texto de mesma linha. */
  --space-1: 4px; /* Gap entre chip e chip, padding de badge. */
  --space-2: 8px; /* Gap entre rótulo e campo, padding vertical de controle pequeno. */
  --space-3: 12px; /* Padding horizontal de input e de botão médio. */
  --space-4: 16px; /* Padding padrão de card e de célula de tabela. */
  --space-5: 20px; /* Gap entre cards em grade densa. */
  --space-6: 24px; /* Padding de painel, gap entre grupos de campos. */
  --space-8: 32px; /* Gap entre blocos de uma tela do app. */
  --space-10: 40px; /* Respiro acima de um título de seção. */
  --space-12: 48px; /* Separação entre seções do app. */
  --space-16: 64px; /* Padding vertical de seção da landing em telas pequenas. */
  --space-20: 80px; /* Padding vertical de seção da landing. */
  --space-24: 96px; /* Padding vertical do hero da landing. */

  /* Size. Alturas de controle e tamanhos de ícone. Alvo de toque mínimo de 44px em telas pequenas, atingido com padding. */
  --control-sm: 32px; /* Botão e input compactos dentro de tabela ou barra de filtro. */
  --control-md: 40px; /* Altura padrão de botão, input e select. */
  --control-lg: 48px; /* Ação primária do hero e formulários de uma coluna. */
  --icon-sm: 16px; /* Ícone dentro de texto body-sm, label ou badge. */
  --icon-md: 20px; /* Ícone padrão de botão e de item de navegação. */
  --icon-lg: 24px; /* Ícone de card vazio, de seção e de estado. */

  /* Stroke. Espessuras de traço, para borda e para série de gráfico. */
  --stroke-hairline: 1px; /* Borda de card, input, divisória e grade de gráfico. */
  --stroke-strong: 2px; /* Anel focus, indicador de aba ativa, linha de série principal. */
  --stroke-heavy: 3px; /* Linha de referência do gráfico, como limiar ou meta. */

  /* Layer. Camadas. Nada fora desta escala. */
  --z-base: 0; /* Conteúdo do fluxo. */
  --z-sticky: 100; /* Cabeçalho fixo e cabeçalho de tabela. */
  --z-overlay: 800; /* Dropdown, popover, tooltip. */
  --z-modal: 900; /* Scrim, modal e drawer. */
  --z-toast: 1000; /* Notificação, sempre acima de tudo. */

  /* Layout. Phone-first: every value here is the phone's, and wider screens
     only add. Breakpoints are NOT tokens: a CSS variable cannot be read inside
     an @media condition, so they stay Tailwind's defaults (sm, md, lg) and are
     written nowhere. Not from the designer's artifact; set 2026-09-22 from the
     widths the two shells already used. */
  --width-content: 672px; /* Content column: every app screen, landing reading text. */
  --width-site: 1024px; /* Landing shell: header, footer, sections. */
  --gutter: var(--space-4); /* Side padding between the content and the screen edge. */
  --touch-target: 44px; /* Minimum tap area on a touch screen (the Size note above). */
  --tab-bar-height: 56px; /* App's bottom tab bar, above the phone's safe area. */
  --top-bar-height: 80px; /* App's top bar and the landing header: fits the stacked lockup. */

  /* Type scale: family / size / line height / weight / tracking. Tailwind reads
     it as text-<name> (size, line height, weight, tracking); the family is not
     part of a Tailwind text size, so the metric and code styles also take
     font-mono. */
  /* Display (display) */
  /* display-xl: Hero da landing. Uma linha, no máximo duas. */
  --type-display-xl-family: var(--ds-font-display);
  --type-display-xl-size: 64px;
  --type-display-xl-line: 58px;
  --type-display-xl-weight: 800;
  --type-display-xl-tracking: -0.03em;
  /* display-lg: Abertura de seção da landing. */
  --type-display-lg-family: var(--ds-font-display);
  --type-display-lg-size: 48px;
  --type-display-lg-line: 46px;
  --type-display-lg-weight: 800;
  --type-display-lg-tracking: -0.025em;
  /* display-md: Título de página do app. */
  --type-display-md-family: var(--ds-font-display);
  --type-display-md-size: 36px;
  --type-display-md-line: 38px;
  --type-display-md-weight: 700;
  --type-display-md-tracking: -0.02em;
  /* Títulos (sans) */
  /* heading-1: Título de tela. */
  --type-heading-1-family: var(--ds-font-body);
  --type-heading-1-size: 30px;
  --type-heading-1-line: 36px;
  --type-heading-1-weight: 700;
  --type-heading-1-tracking: -0.015em;
  /* heading-2: Título de seção. */
  --type-heading-2-family: var(--ds-font-body);
  --type-heading-2-size: 24px;
  --type-heading-2-line: 30px;
  --type-heading-2-weight: 700;
  --type-heading-2-tracking: -0.01em;
  /* heading-3: Título de card. */
  --type-heading-3-family: var(--ds-font-body);
  --type-heading-3-size: 20px;
  --type-heading-3-line: 26px;
  --type-heading-3-weight: 600;
  --type-heading-3-tracking: -0.005em;
  /* heading-4: Subtítulo dentro de card, cabeçalho de grupo de lista. */
  --type-heading-4-family: var(--ds-font-body);
  --type-heading-4-size: 16px;
  --type-heading-4-line: 22px;
  --type-heading-4-weight: 600;
  /* eyebrow: Sobretítulo. Sempre em caixa alta, sempre em subtle-foreground ou primary-ink. */
  --type-eyebrow-family: var(--ds-font-body);
  --type-eyebrow-size: 12px;
  --type-eyebrow-line: 14px;
  --type-eyebrow-weight: 700;
  --type-eyebrow-tracking: 0.14em;
  /* Texto (sans) */
  /* body-lg: Texto de leitura longa na landing e em explicações do coach. */
  --type-body-lg-family: var(--ds-font-body);
  --type-body-lg-size: 17px;
  --type-body-lg-line: 26px;
  --type-body-lg-weight: 400;
  /* body: Texto padrão da interface. */
  --type-body-family: var(--ds-font-body);
  --type-body-size: 15px;
  --type-body-line: 23px;
  --type-body-weight: 400;
  /* body-sm: Texto de apoio, descrição de campo, nota de rodapé de card. */
  --type-body-sm-family: var(--ds-font-body);
  --type-body-sm-size: 13px;
  --type-body-sm-line: 20px;
  --type-body-sm-weight: 400;
  /* label: Rótulo de campo, cabeçalho de coluna, texto de botão pequeno. */
  --type-label-family: var(--ds-font-body);
  --type-label-size: 13px;
  --type-label-line: 16px;
  --type-label-weight: 600;
  --type-label-tracking: 0.01em;
  /* caption: Legenda de gráfico, carimbo de data, unidade solta. */
  --type-caption-family: var(--ds-font-body);
  --type-caption-size: 12px;
  --type-caption-line: 16px;
  --type-caption-weight: 500;
  --type-caption-tracking: 0.01em;
  /* Métricas (mono) */
  /* metric-xl: Número herói de um painel. Sempre com algarismos tabulares. */
  --type-metric-xl-family: var(--ds-font-mono);
  --type-metric-xl-size: 56px;
  --type-metric-xl-line: 52px;
  --type-metric-xl-weight: 700;
  --type-metric-xl-tracking: -0.02em;
  /* metric-lg: Métrica principal de card. */
  --type-metric-lg-family: var(--ds-font-mono);
  --type-metric-lg-size: 36px;
  --type-metric-lg-line: 36px;
  --type-metric-lg-weight: 700;
  --type-metric-lg-tracking: -0.01em;
  /* metric-md: Métrica secundária, célula de resumo. */
  --type-metric-md-family: var(--ds-font-mono);
  --type-metric-md-size: 24px;
  --type-metric-md-line: 26px;
  --type-metric-md-weight: 600;
  /* metric-sm: Número dentro de tabela ou de linha de lista. Mantém o alinhamento vertical das colunas. */
  --type-metric-sm-family: var(--ds-font-mono);
  --type-metric-sm-size: 15px;
  --type-metric-sm-line: 20px;
  --type-metric-sm-weight: 500;
  /* code: Nome de tool do MCP, trecho de JSON, bloco de código na documentação. */
  --type-code-family: var(--ds-font-mono);
  --type-code-size: 13px;
  --type-code-line: 20px;
  --type-code-weight: 400;

  /* Colour, dark theme (the default). Sistema dark-first: o tema Escuro é o padrão em todas as superfícies. O tema Claro existe para impressão, leitura diurna e para clientes MCP que forçam fundo claro. */
  /* The four surfaces, from the page up: background, card, popover, secondary. */
  /* Fundo da página e do canvas de gráficos. Base de `foreground`, `muted-foreground` e `subtle-foreground`. */
  --background: hsl(217.5 28.6% 5.5%);
  /* Superfície padrão: cards, painéis, linhas de tabela. Base de `foreground`, `muted-foreground` e `subtle-foreground`. */
  --card: hsl(218.2 25.6% 8.4%);
  /* Superfície elevada: hover de linha, cabeçalho fixo, popover. Base de `foreground`, `muted-foreground` e `subtle-foreground`. */
  --popover: hsl(217.5 23.5% 13.3%);
  /* Preenchimento de controle: input, select, chip, trilho de barra. Base de `foreground`, `muted-foreground` e `subtle-foreground`. */
  --secondary: hsl(214.7 22.4% 16.7%);
  /* Véu atrás de modal e drawer. Nunca receba texto direto. */
  --scrim: rgba(4,6,10,0.72);
  /* Divisória decorativa: separador de lista, borda de card em repouso. Não carrega significado, então não precisa atingir 3:1. */
  --border: hsl(215.5 20.8% 20.8%);
  /* Borda de controle interativo e de célula de tabela de dados, sobre `background` a `secondary`. Atinge 3:1 nas quatro superfícies. */
  --border-strong: hsl(215.2 11.9% 47.6%);
  /* Texto primário, títulos e números, sobre `background` a `secondary` e sobre os `-wash`. */
  --foreground: hsl(213.3 36% 95.1%);
  /* Texto secundário, rótulos e descrições, sobre `background` a `secondary`. */
  --muted-foreground: hsl(213.6 17.2% 71.6%);
  /* Texto terciário: placeholder, unidade, carimbo de data, sobre `background` a `secondary`. */
  --subtle-foreground: hsl(214.6 12.5% 59.2%);
  /* Texto e ícone sobre preenchimento `primary` ou `primary-hover`. Nunca use branco sobre o lima. */
  --primary-foreground: hsl(81.4 77.8% 3.5%);
  /* Lima Prova: preenchimento da ação primária, indicador de aba ativa, destaque da série do atleta. Recebe `primary-foreground`. No tema claro o lima é aprofundado para segurar contra o papel. */
  --primary: hsl(71.4 90.9% 61.4%);
  /* Estado hover e active do preenchimento `primary`. Recebe `primary-foreground`. */
  --primary-hover: hsl(71.8 100% 71%);
  /* Contorno de 1px obrigatório em todo preenchimento `primary` no tema claro, onde o lima quase não se separa de `card`. */
  --primary-border: hsl(71.8 62.3% 47.8%);
  /* Lima como texto, ícone ou linha fina sobre `background` a `secondary`. Use este, nunca `primary`, quando o lima virar texto. */
  --primary-ink: hsl(71.1 84% 58.4%);
  /* Fundo de realce discreto: linha selecionada, bloco de dica do coach. Recebe `foreground` ou `primary-ink`. */
  --primary-wash: hsl(78.6 64.4% 8.8%);
  /* Anel de foco sólido de 2px com 2px de afastamento, em qualquer elemento focável. Atinge 3:1 nas quatro superfícies dos dois temas. */
  --ring: hsl(71.4 90.9% 61.4%);
  /* Texto e ícone de sucesso, treino concluído, meta atingida, sobre `background` a `secondary` e sobre `success-wash`. */
  --success: hsl(153.1 60.2% 52.7%);
  /* Fundo de aviso de sucesso. Recebe `foreground` ou `success`. */
  --success-wash: hsl(152.7 40.7% 10.6%);
  /* Texto e ícone de atenção: carga subindo rápido, sono curto, dado faltando. Sobre `background` a `secondary` e sobre `warning-wash`. */
  --warning: hsl(40.7 90.9% 57.1%);
  /* Fundo de aviso de atenção. Recebe `foreground` ou `warning`. */
  --warning-wash: hsl(43.6 64.7% 10%);
  /* Texto e ícone de risco: sinal de overreaching, ação destrutiva. Sobre `background` a `secondary` e sobre `destructive-wash`. */
  --destructive: hsl(6.1 100% 71%);
  /* Fundo de aviso de risco. Recebe `foreground` ou `destructive`. */
  --destructive-wash: hsl(6.9 41.9% 12.2%);
  /* Texto e ícone de informação neutra, nota metodológica, origem do dado. Sobre `background` a `secondary` e sobre `info-wash`. */
  --info: hsl(211.6 100% 70.6%);
  /* Fundo de bloco informativo. Recebe `foreground` ou `info`. */
  --info-wash: hsl(215 54.5% 12.9%);
  /* Zona 1, recuperação: barras, faixas e legendas de zona. Sempre acompanhada do número da zona, nunca só da cor. */
  --zone-1: hsl(212.6 17.1% 59.8%);
  /* Zona 2, base aeróbica. Cor mais usada do painel de volume. */
  --zone-2: hsl(215.3 88.4% 66.1%);
  /* Zona 3, tempo. */
  --zone-3: hsl(178.8 62.9% 45.5%);
  /* Zona 4, limiar. */
  --zone-4: hsl(35 88.4% 62.7%);
  /* Zona 5, VO2max. */
  --zone-5: hsl(10.7 94.2% 66.1%);
  /* Zona 6, neuromuscular e sprint. */
  --zone-6: hsl(336.1 82.7% 66.1%);
  /* Linhas de grade do gráfico. Decorativas, mantenha-as abaixo da série. */
  --chart-grid: hsl(214.3 24.7% 16.7%);
  /* Linha e marcação de eixo, e trilho de escala. Atinge 3:1 nas quatro superfícies. */
  --chart-axis: hsl(213.3 10.7% 50.4%);
  /* Trilho vazio de barra, medidor ou anel de progresso. */
  --chart-track: hsl(217.5 23.5% 13.3%);

  /* Shadow. No tema Escuro a elevação vem da superfície e da borda; a sombra só reforça. No tema Claro a sombra é o recurso principal. */
  --ds-shadow-sm: 0 1px 2px rgba(0,0,0,0.6);
  --ds-shadow-md: 0 8px 24px rgba(0,0,0,0.55);
  --ds-shadow-lg: 0 24px 64px rgba(0,0,0,0.6);
  --ds-shadow-focus: 0 0 0 3px rgba(212,246,67,0.32);
  color-scheme: dark;
}

.light {
  /* Colour, light theme. Same names; each one's usage note is in the :root block. */
  --background: hsl(216 26.3% 96.3%);
  --card: hsl(0 0% 100%);
  --popover: hsl(213.3 27.3% 93.5%);
  --secondary: hsl(212.7 24.4% 91.2%);
  --scrim: rgba(13,17,23,0.44);
  --border: hsl(214.3 24.1% 88.6%);
  --border-strong: hsl(213.3 10.8% 48.8%);
  --foreground: hsl(216 27.8% 7.1%);
  --muted-foreground: hsl(215 15.6% 30.2%);
  --subtle-foreground: hsl(212.5 11.8% 40%);
  --primary-foreground: hsl(81.4 77.8% 3.5%);
  --primary: hsl(69.6 100% 39.4%);
  --primary-hover: hsl(69.6 100% 35.5%);
  --primary-border: hsl(71.3 100% 26.1%);
  --primary-ink: hsl(75.6 100% 19.6%);
  --primary-wash: hsl(71.3 77.4% 87.8%);
  --ring: hsl(75.6 100% 19.6%);
  --success: hsl(155.3 80.2% 23.7%);
  --success-wash: hsl(150 47.4% 92.5%);
  --warning: hsl(39.8 100% 24.5%);
  --warning-wash: hsl(42.2 82.2% 91.2%);
  --destructive: hsl(4.8 71.3% 41%);
  --destructive-wash: hsl(8.2 78.6% 94.5%);
  --info: hsl(213.7 84.5% 38%);
  --info-wash: hsl(213.9 85.2% 94.7%);
  --zone-1: hsl(212.3 13.1% 38.8%);
  --zone-2: hsl(216.9 71.2% 42.2%);
  --zone-3: hsl(178.1 85.5% 21.6%);
  --zone-4: hsl(37.8 100% 27.1%);
  --zone-5: hsl(14.5 78.5% 38.2%);
  --zone-6: hsl(335.4 60% 38.2%);
  --chart-grid: hsl(212.7 26.8% 92%);
  --chart-axis: hsl(213.3 10.8% 48.8%);
  --chart-track: hsl(213.3 27.3% 93.5%);

  --ds-shadow-sm: 0 1px 2px rgba(13,17,23,0.08);
  --ds-shadow-md: 0 8px 24px rgba(13,17,23,0.10);
  --ds-shadow-lg: 0 24px 64px rgba(13,17,23,0.14);
  --ds-shadow-focus: 0 0 0 3px rgba(74,100,0,0.26);
  color-scheme: light;
}

/* shadcn names that this system does not tell apart. Each one IS another token,
   so it points at it instead of repeating the value, and follows it in both
   themes. Declared on .light as well as :root so the reference is re-resolved
   wherever the theme class sits. */
:root,
.light {
  --card-foreground: var(--foreground);
  --popover-foreground: var(--foreground);
  --secondary-foreground: var(--foreground);
  --accent: var(--popover); /* hover and skeleton fill: the surface one step up */
  --accent-foreground: var(--foreground);
  --muted: var(--popover);
  --input: var(--border-strong);
}

/* Every number an athlete compares: mono, tabular figures. One helper so the
   surfaces cannot drift on it. */
.tabular {
  font-family: var(--ds-font-mono);
  font-variant-numeric: tabular-nums;
}
