/* Design tokens, typography and the self-hosted fonts — the foundation
   shared by **all seven pages**, public ones included. Everything that is
   specific to the signed-in app (the nav shell, the cards, the controls)
   lives in base.css alongside it, which only the five authenticated pages
   load.

   The split exists because of the landing page. It is the one page seen on
   a cold cache by someone with no reason to wait, and shipping it the
   sidebar's CSS to render a hero it does not have is the kind of thing that
   is invisible in review and measurable on a phone. Two files also means
   arriving at /area-cliente from / already has this one cached.

   The dark-mode variable *values* are not here, only the light ones — the
   *selectors* differ page to page (area-cliente.html and admin.html gate
   theirs behind html.authenticated, since they are also login screens and
   must stay light until someone is signed in; index.html has no dark mode
   at all, deliberately). Each page declares its own; see their <style>.

   Render-blocking, like the inline <style> it replaces — the browser holds
   first paint on an external stylesheet exactly as it does an inline one,
   so extracting it adds no new flash. What it changes is repeat
   navigations: once cached, the request and the re-parse are both skipped
   on every page load for the rest of the session. */

/* Every page navigation here is a full document load — no SPA, no build
   step — so the browser has nothing to paint between unloading the old
   page and the first paint of the new one: a plain white flash, seen on
   video on a real phone, that no amount of JS on either page can reach,
   since it happens before any of it runs. Declaring this on both sides of
   a same-origin navigation (present on all seven pages, not just the four
   sharing this file) makes Chromium capture the outgoing page and
   cross-fade it into the incoming one instead of hard-cutting to blank.
   Firefox and Safari don't implement cross-document view transitions yet
   and silently ignore the rule — same white flash as before, never worse. */
@view-transition {
  navigation: auto;
}

/* ---- Fonts, served from this origin ----
   Both families are Open Font License, and both are served from
   /assets/fonts/ rather than from Google's CDN. That is not a preference:
   privacidade.html tells every visitor that no page loads a third-party
   resource, and privacy.e2e.cjs fails the build if one does. A stylesheet
   link to fonts.googleapis.com would hand Google the IP address of
   everybody who opens the app — including the elderly person's family
   checking a transcript — to save hosting 188KB.

   Only the latin and latin-ext subsets are here; the UI ships in
   Portuguese and English, and unicode-range means a browser downloads
   neither file until it actually has to render a glyph from that range.

   Work Sans is a variable font: one file covers 400-700, which is why
   there is a single file rather than the four weights the design uses.
   Google serves the same bytes for each of those weights.

   font-display: swap — the fallback stack in `body` renders immediately
   and the webfont swaps in when it lands. This app is used on phones on
   mobile data; a blank page waiting on a typeface is the wrong trade.

   Deliberately not preloaded from the pages' <head>. Chrome ranks
   as="font" high, and on a page still waiting on /api/auth/me that
   priority is taken from shared.js — the script that paints the top bar
   and the credit strip from the cached identity. navigation.e2e.cjs fails
   on it: with the preloads in, the strip was no longer on screen at the
   moment that suite samples for it. swap means nothing waits on these
   files regardless, so a preload buys an earlier swap and pays for it with
   a later first paint of the bar. */
@font-face {
  font-family: "Work Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/work-sans-var-latin.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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Work Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/work-sans-var-latin-ext.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: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/source-serif-4-600-latin.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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/source-serif-4-600-latin-ext.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;
}

/* ---- Design tokens ----
   Warm palette. The background is a cream rather than the blue-grey it
   replaced, and the accent is a deep navy rather than a saturated blue:
   this is an app about phoning someone's grandmother, and the previous
   palette read like a billing dashboard.

   Two accents, doing different jobs, which is why they are separate
   tokens rather than one:
     --accent  navy, for anything that carries meaning — links, primary
               buttons, the selected state of a control.
     --brand   amber, for the product's own identity and for the one
               "start something new" action per page (Novo perfil,
               Carregar créditos). Used sparingly on purpose; an accent
               that appears on every third element stops being one.

   --brand-text is white, matching every other filled button's on-color
   (--accent-text, --ok-text on the call icon) — explicit product direction,
   overriding an earlier version of this file that used near-black here on
   contrast grounds (white-on-#e0993d is 2.4:1, below WCAG AA's 4.5:1 for
   body text). Left as the deliberate call it is rather than re-litigated:
   if it needs revisiting, that's a contrast/palette conversation, not a
   one-line revert. */
:root {
  color-scheme: light;
  --bg: #f7f5f1;
  --card: #ffffff;
  --border: #e6e1d8;
  /* Hairlines *inside* a card, where the card's own border is already
     doing the containing — one step lighter, or the card reads as a
     table of boxes rather than one surface. */
  --border-soft: #f0ece2;
  --text: #2b2620;
  --muted: #71695c;
  /* Helper text under a field. Deliberately darker than the #a89f8f the
     mockup used: that shade is 2.6:1 on white, and these are real
     sentences people have to read, not decoration. */
  --faint: #7d7466;
  --accent: #2a3f5f;
  --accent-hover: #223349;
  --accent-text: #ffffff;
  --brand: #e0993d;
  --brand-hover: #d08c31;
  --brand-text: #ffffff;
  --danger: #b0483a;
  --danger-bg: #fbebe7;
  --ok-bg: #eaf3ea;
  --ok-text: #2f6b3f;
  --surface: #f2efe8;
  --warm: #e0993d;
  --warm-bg: #fdf1de;
  --warm-text: #8a5a13;

  /* One scale, three steps, so a card and a button can't drift apart page
     to page the way they did when every page hard-coded its own radii. */
  --radius-card: 14px;
  --radius-control: 9px;
  --radius-sm: 7px;

  --shadow-card: 0 1px 2px rgba(42, 34, 20, 0.04);
  --shadow-pop: 0 8px 30px rgba(42, 63, 95, 0.09);

  --nav-width: 232px;   /* the sidebar, at 900px and up */
  --nav-height: 60px;   /* the bottom tab bar, below 900px */
}

/* The dark overrides for these same tokens live in each page's own
   <style>, not here — see the file header for why the selectors have to
   differ page to page. They are warm-neutral rather than the blue-black
   they replaced, so the amber and the cream still read as the same
   product with the lights off. */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  /* Web fonts arrive after first paint (display=swap), and Work Sans is
     narrower than the system stack it swaps in over. Locking the fallback
     to the same nominal size keeps the reflow to something you don't
     notice rather than a visible jump in every label at once. */
  font-synthesis-weight: none;
}

/* Headings and the wordmark are the serif; everything you *operate* — a
   label, a button, a number in a table — stays in the sans. The mix is
   the whole point of the design: it's what stops a settings form reading
   like a spreadsheet. */
h1, h2, h3, .serif {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Keyboard focus, defined once. The browser default is a 1px hairline
   that disappears against a mid-tone button; this is the same ring on
   every control regardless of its background. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

[hidden] { display: none !important; }
