/* Base: fonte, reset mínimo, foco, rolagem e seleção.
 *
 * Só o que vale para o documento inteiro. Componente é em components.css.
 */

/* Inter, servida daqui. Nada de Google Fonts em tempo de execução: o painel é
 * instalado como aplicativo e precisa abrir com rede ruim — uma fonte externa
 * viraria texto invisível enquanto a requisição não volta.
 *
 * `font-display: swap`: o texto aparece na fonte do sistema e troca quando a
 * Inter chega. O contrário (`block`) deixa a tela muda por até três segundos.
 *
 * Dois arquivos por peso, latin e latin-ext, com `unicode-range`: o navegador
 * só baixa o segundo se a página tiver caractere que precise dele. */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fontes/inter-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fontes/inter-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fontes/inter-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fontes/inter-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fontes/inter-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fontes/inter-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fontes/inter-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fontes/inter-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* { box-sizing: border-box; }

body {
  font-family: var(--fonte);
  font-weight: var(--peso-normal);
  background: var(--cor-fundo);
  color: var(--cor-texto);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Botão nativo vem com a seta do navegador. Num painel onde quase tudo é
 * botão, a mãozinha é o que diz "isto se clica". */
/* `hidden` tem de VENCER o `display` das classes.
 *
 * O atributo `hidden` vale `display: none` pela folha do navegador — e qualquer
 * `display: flex` de uma classe ganha dele, por especificidade. O elemento fica
 * marcado como escondido e continua na tela.
 *
 * O painel já tinha tropeçado nisso uma vez: existe um
 * `.agenda-form__desmarcar[hidden] { display: none }` remendando o caso
 * daquela tela. Isto resolve a classe inteira do problema, para o próximo não
 * precisar descobrir de novo.
 *
 * `!important` é necessário: sem ele, a regra continuaria perdendo para a
 * classe. Quem precisar mostrar um elemento tira o atributo, que é o que o
 * atributo quer dizer. */
[hidden] { display: none !important; }

/* `font-size: inherit` (UX 1.2): sem ele, todo botão sem tamanho próprio ficava com os 13,33px do navegador — o sinal de "botão sem
 * estilo" que o documento de melhorias achou. Quem tem tamanho próprio (quase todos) continua com o dele: esta regra é a mais fraca. */
button, [role="button"] { cursor: pointer; font-family: inherit; font-size: inherit; }
:disabled { cursor: default; }
input, select, textarea { font-family: inherit; }

/* Foco visível de verdade, e só para quem navega por teclado.
 *
 * `:focus-visible` e não `:focus`: com `:focus` o anel aparece também em todo
 * clique de mouse, e foi por isso que alguém, um dia, escreveu `outline:none`
 * — e aí quem usa teclado ficou sem saber onde está. */
:focus-visible {
  outline: 2px solid var(--cor-foco);
  outline-offset: 2px;
  border-radius: var(--raio-sm);
}

/* No modo de alto contraste do sistema, `box-shadow` é apagado — quem desenha
 * o foco com sombra perde o indicador inteiro. `Highlight` é cor do sistema, a
 * única que esse modo não substitui. WCAG 2.4.7, nível A. */
@media (forced-colors: active) {
  :focus-visible { outline: 2px solid Highlight !important; outline-offset: 2px !important; }
}

::selection { background: var(--cor-acento-suave); color: var(--cor-texto); }

* { scrollbar-width: thin; scrollbar-color: var(--cor-borda-forte) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background-color: var(--cor-borda-forte);
  border-radius: var(--raio-pill);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Quem pediu menos movimento no sistema recebe menos movimento. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
