/* FABIM Controle — base: reset e elementos nus. */

/* Emojis modernos e consistentes em qualquer aparelho: fonte de cor Twemoji
   servida localmente (offline). O unicode-range restringe a fonte apenas as
   faixas de emoji, entao numeros/texto continuam na fonte normal (a fonte
   Twemoji contem glifos de digitos 0-9 para teclas tipo 1-emoji, que NAO
   podem sequestrar os numeros das mensagens). */
@font-face {
  font-family: "Twemoji";
  src: url("/vendor/twemoji.ttf?v=1") format("truetype");
  font-display: swap;
  unicode-range: U+00A9, U+00AE, U+203C, U+2049, U+2122, U+2139, U+2194-2199,
    U+21A9-21AA, U+231A-231B, U+2328, U+23CF, U+23E9-23F3, U+23F8-23FA, U+24C2,
    U+25AA-25AB, U+25B6, U+25C0, U+25FB-25FE, U+2600-27BF, U+2934-2935,
    U+2B00-2BFF, U+3030, U+303D, U+3297, U+3299, U+20E3, U+FE00-FE0F,
    U+1F000-1FAFF, U+E0020-E007F;
}

@layer base {
  * { box-sizing: border-box; }

  [hidden] { display: none !important; }

  html {
    min-height: 100%;
    color-scheme: dark;
    background: var(--fabim-canvas);
  }

  html.light { color-scheme: light; }

  body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background: var(--fabim-canvas);
    color: var(--fabim-text);
    font-family: "Twemoji", "Segoe UI Variable", "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif;
    font-size: var(--fs-3);
    line-height: 1.45;
    letter-spacing: 0;
    text-rendering: optimizeLegibility;
  }

  html.light body {
    background: var(--fabim-canvas);
  }

  h1, h2, h3, p { margin-top: 0; }

  h1 {
    margin-bottom: 0;
    color: var(--fabim-text);
    font-size: var(--fs-6);
    font-weight: var(--fw-bold);
    line-height: 1.2;
    letter-spacing: 0;
  }

  h2 {
    margin-bottom: 0;
    color: var(--fabim-text);
    font-size: var(--fs-4);
    font-weight: var(--fw-bold);
    line-height: 1.3;
    letter-spacing: 0;
  }

  a { color: var(--app-bronze); }

  label {
    display: grid;
    gap: 6px;
    color: var(--fabim-muted);
    font-size: var(--fs-1);
    font-weight: var(--fw-medium);
  }

  input,
  select,
  textarea {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--fabim-line);
    border-radius: var(--r-1);
    background: var(--fabim-surface-raised);
    color: var(--fabim-text);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
    font: inherit;
    letter-spacing: 0;
  }

  input:hover,
  select:hover,
  textarea:hover { border-color: var(--fabim-line-strong); }

  input:focus,
  select:focus,
  textarea:focus {
    border-color: var(--fabim-bronze);
    background: var(--fabim-surface-soft);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }

  input::placeholder,
  textarea::placeholder { color: color-mix(in srgb, var(--fabim-muted) 68%, transparent); }

  select { color-scheme: dark; }
  html.light select { color-scheme: light; }

  html.light input,
  html.light select,
  html.light textarea {
    background: linear-gradient(180deg, #ffffff, #f5f8fb);
    color: var(--fabim-text);
  }

  button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid var(--accent-strong);
    border-radius: var(--r-1);
    background: var(--accent-strong);
    color: #ffffff;
    box-shadow: none;
    font: inherit;
    font-size: var(--fs-2);
    font-weight: var(--fw-medium);
    letter-spacing: 0;
    cursor: pointer;
  }

  button:hover {
    border-color: var(--fabim-bronze);
    background: var(--fabim-bronze);
    color: #ffffff;
    transform: translateY(-1px);
  }

  button:active { transform: translateY(0); box-shadow: inset 0 1px 3px rgba(2, 6, 12, 0.28); }

  html.light button { color: #ffffff; }

  button svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    stroke-width: 1.9;
  }

  dialog { color: var(--fabim-text); }

  table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }

  button,
  input,
  select,
  textarea,
  dialog {
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  }

  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  [tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      scroll-behavior: auto !important;
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
    }
  }
}
