/* AG Menu — base styles shared by every page (no framework). Sizes in rem: the a11y text size scales everything.
   Look and tokens follow the models in /modelo (lead.html, loja.html); colors were adjusted to WCAG AA. */

/* Fonts of the models, self-hosted (no CDN). Variable files, latin subset. */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/inter.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/space-grotesk.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
}

:root {
  --color-text: #1a1a1f;
  --color-bg: #ffffff;              /* cards, fields */
  --color-page: #fbfaf7;            /* warm off-white behind everything */
  --color-surface: #f7f5f0;
  --color-border: #e8e4dc;
  --color-border-soft: #efebe3;
  --color-field-border: #85858d;    /* 3.6:1 on white (form controls need 3:1) */
  --color-muted: #56565e;           /* 7.3:1 on white */
  --color-subtle: #6b6b73;          /* 5.3:1 on white (the models' #8e8e96 fails AA) */
  --color-primary: #d63420;         /* 4.8:1 with white; each store overrides it */
  --color-primary-2: #ff6b3d;       /* decoration only (glows), never behind text */
  --color-primary-contrast: #ffffff;
  --color-primary-text: #d63420;    /* primary used as text on white, always >= 4.5:1 */
  --color-secondary: #0f0f14;
  --color-secondary-contrast: #ffffff;
  --color-accent: #00855f;          /* WhatsApp green, 4.6:1 with white */
  --color-accent-dark: #00694b;
  --color-premium: #6b4eff;
  --color-success: #17692f;
  --color-danger: #b91c1c;
  --a11y-blue: #0b57d0;
  --focus: #1a5fb4;
  --gradient-primary: linear-gradient(135deg, #c42a17, #dc3a1e);   /* both ends >= 4.5:1 with white */
  --gradient-accent: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow: 0 2px 8px rgb(26 26 31 / .05);
  --shadow-card: 0 10px 40px -15px rgb(26 26 31 / .14);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }   /* components with display:flex/grid must still hide */
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); line-height: 1.55; color: var(--color-text); background: var(--color-page);
  overflow-wrap: break-word; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
a { color: var(--focus); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: max(1rem, 16px); }   /* iPhone does not zoom on focus */

/* Focus always visible, with a white halo so it also shows on dark backgrounds. */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px #fff; }
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }

@media (prefers-reduced-motion: no-preference) {
  html:not(.a11y-no-motion) { scroll-behavior: smooth; }
}

.container { width: min(1180px, 100% - 2.5rem); margin-inline: auto; padding-block: 2rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 1000;
  padding: .75rem 1rem; background: var(--color-bg); color: var(--focus); font-weight: 700;
  border: 2px solid var(--focus); border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }

/* Buttons (pills, as in the models) */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .5rem 1.35rem; border: 1px solid transparent; border-radius: 999px;
  background: var(--color-primary); color: var(--color-primary-contrast); font-weight: 600; cursor: pointer; text-decoration: none;
  white-space: nowrap; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .2s, background-color .2s, color .2s;
}
.button:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 10px 22px -12px rgb(26 26 31 / .45); }
.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: inherit; cursor: pointer;
}
.icon-button:hover { background: var(--color-surface); }
.badge {
  display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700;
  background: var(--color-primary); color: var(--color-primary-contrast); vertical-align: .1em;
}

/* Native <dialog>: focus trap, Esc and focus return come from the browser. */
dialog {
  width: min(34rem, 100% - 2rem); max-height: min(85vh, 48rem); padding: 1.5rem; overflow: auto;
  border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-bg); color: var(--color-text);
  box-shadow: 0 30px 80px -20px rgb(26 26 31 / .35);
}
dialog::backdrop { background: rgb(26 26 31 / .5); backdrop-filter: blur(4px); }
.dialog__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.dialog__title { margin: 0; font-size: 1.25rem; }
.dialog__footer { display: flex; justify-content: flex-end; margin-top: 1.25rem; }

/* Accessibility bar (docs/09) — right side, mid-screen: VLibras button on top, a11y panel button below. */
.a11y-toggle {
  position: fixed; right: 0; top: calc(50% + 4px); z-index: 900;
  display: flex; align-items: center; justify-content: center; width: 48px; height: 48px;
  border: 2px solid #fff; border-right: 0; border-radius: 50% 0 0 50%;
  background: var(--a11y-blue); color: #fff; cursor: pointer; box-shadow: var(--shadow);
}
.a11y-toggle .icon { width: 28px; height: 28px; }
.a11y-toggle--libras { top: calc(50% - 52px); }
/* The official VLibras button is replaced by ours; it comes back if the plugin stops exposing open(). */
html:not(.libras-official) #vlibras-access-wrapper { display: none !important; }
html.libras-official .a11y-toggle { top: calc(50% + 28px); }
.a11y-panel { width: min(22rem, 100% - 2rem); }
.a11y-panel__group { margin-bottom: .75rem; }
.a11y-panel__label { margin: 0 0 .5rem; font-weight: 700; }
.a11y-panel__row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.a11y-option {
  display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 48px; margin-bottom: .5rem; padding: .5rem .75rem;
  border: 2px solid var(--color-border); border-radius: var(--radius); background: var(--color-bg); cursor: pointer; text-align: left; font-weight: 600;
}
.a11y-panel__row .a11y-option { margin-bottom: 0; }
.a11y-option:hover { border-color: var(--a11y-blue); }
.a11y-option[aria-pressed="true"] { border-color: var(--a11y-blue); background: var(--a11y-blue); color: #fff; }
.a11y-option[aria-pressed="true"]::after { content: "ativado"; margin-left: auto; font-size: .8rem; }
.a11y-option:disabled { opacity: .55; cursor: not-allowed; }
.a11y-option--reset { margin-top: .5rem; border-style: dashed; }
.a11y-panel__note { margin: .75rem 0 0; font-size: .875rem; color: var(--color-muted); }

/* ----- Accessibility preferences (classes on <html>, set by a11y-boot.js before paint) ----- */
html.a11y-text-1 { font-size: 125%; }
html.a11y-text-2 { font-size: 150%; }

html.a11y-links a { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px; }
html.a11y-links button { text-decoration: underline; text-underline-offset: 3px; outline: 2px dashed currentColor; outline-offset: -4px; }

html.a11y-contrast {
  --color-text: #ffffff;
  --color-bg: #000000;
  --color-page: #000000;
  --color-surface: #000000;
  --color-border: #ffffff;
  --color-border-soft: #ffffff;
  --color-field-border: #ffffff;
  --color-muted: #ffffff;
  --color-subtle: #ffffff;
  --color-primary: #ffff00;
  --color-primary-2: #ffff00;
  --color-primary-contrast: #000000;
  --color-primary-text: #ffff00;
  --color-secondary: #000000;
  --color-secondary-contrast: #ffffff;
  --color-accent: #000000;
  --color-accent-dark: #000000;
  --color-premium: #ffff00;
  --color-success: #7dff8f;
  --color-danger: #ff8a8a;
  --a11y-blue: #000000;
  --focus: #00ffff;
  --gradient-primary: linear-gradient(#ffff00, #ffff00);
  --gradient-accent: linear-gradient(#000000, #000000);
  --shadow: none;
  --shadow-card: none;
}
html.a11y-contrast a { color: #ffff00; }
html.a11y-contrast :focus-visible { box-shadow: none; }
html.a11y-contrast dialog, html.a11y-contrast .a11y-toggle { border: 2px solid #fff; }
html.a11y-contrast .a11y-option[aria-pressed="true"] { background: #ffff00; color: #000; border-color: #ffff00; }

html.a11y-no-motion *, html.a11y-no-motion *::before, html.a11y-no-motion *::after {
  animation: none !important; transition: none !important; scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
