/* ============================================================
   IbiraPay — shared theme. Single source of truth for palette,
   type, and the components reused across pages (buttons, footer,
   tools hub cards). Change the accent in ONE place: the --accent*
   tokens below. Alternative accents are listed under :root.

   Fonts (Inter + Space Grotesk) are self-hosted in /pages/fonts/ (latin +
   latin-ext, variable weight, OFL). No third-party origin on the critical path
   and none in the CSP. font-display: swap shows the system fallback
   (--font-body/--font-display) until the woff2 arrives.
   ============================================================ */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/pages/fonts/inter-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/pages/fonts/inter-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: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/pages/fonts/space-grotesk-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/pages/fonts/space-grotesk-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;
}

:root {
  color-scheme: dark;
  /* base — soft charcoal, not pure black */
  --bg: #0f1315;
  --surface: #171c1f;
  --surface-2: #1e252a;
  --elevate: #252e34;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --ink: #e7eaec;
  --ink-soft: #98a1a8;
  --ink-dim: #828c92; /* AA on bg/surface/surface-2: 5.44/5.00/4.52 */

  /* ACCENT — muted teal-green (primary). Swap these 3 to restyle. */
  --accent: #3e9c93;
  --accent-2: #57beb2;
  --accent-soft: rgba(62, 156, 147, 0.12);
  /* Alternatives:
     Slate indigo: #6e82c8 / #8aa0e6 / rgba(110,130,200,.12)
     Muted sage:   #7fa98c / #9ac6a8 / rgba(127,169,140,.12) */

  /* market data — muted, not harsh */
  --pos: #4caf7d;
  --neg: #d66b6b;

  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.3);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", var(--font-body);
}

/* LIGHT — follows the visitor's system setting (no toggle, by design). Same teal,
   darkened where it is text (#1f7a71 = 4.8:1 on --bg); buttons keep --accent with
   dark ink (5.8:1). Every pair checked against WCAG AA. */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f5f7f7;
    --surface: #ffffff;
    --surface-2: #f0f3f3;
    --elevate: #e6ebeb;
    --line: rgba(15, 19, 21, 0.08);
    --line-strong: rgba(15, 19, 21, 0.14);
    --ink: #14191c;
    --ink-soft: #4a555b;
    --ink-dim: #5f6b72; /* AA on every light surface (>= 4.55) */
    --accent-2: #1f7a71;
    --pos: #23804f;
    --neg: #c0392b;
    --shadow: 0 8px 30px rgba(15, 19, 21, 0.08);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}

.tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

a {
  color: var(--accent-2);
}

/* ---------- buttons ---------- */
.btn {
  --_bg: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--_bg);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease,
    transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  --_bg: var(--accent);
  border-color: transparent;
  color: #06110f;
}

.btn-primary:hover {
  --_bg: var(--accent-2);
  box-shadow: 0 6px 20px var(--accent-soft);
}

.btn-ghost {
  --_bg: transparent;
  color: var(--ink);
}

.btn-ghost:hover {
  --_bg: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent-2);
}

/* ---------- shared footer ---------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 48px 24px 32px;
}

.site-footer .footer-inner {
  max-width: 1080px;
  margin: 0 auto;
}

.site-footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  margin-bottom: 32px;
}

.site-footer .footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 140px;
}

.site-footer .footer-col h4 {
  font-family: var(--font-display);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin: 0 0 4px;
}

.site-footer .footer-col a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s ease;
}

.site-footer .footer-col a:hover {
  color: var(--accent-2);
}

.site-footer .footer-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: baseline;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-dim);
}

.site-footer .footer-trust strong {
  color: var(--ink-soft);
  font-weight: 600;
}

/* ============================================================
   TOOLS HUB — data-driven card grid (shared by home + ferramentas)
   ============================================================ */
.tools-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.tools-search {
  width: 100%;
  max-width: 420px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tools-search::placeholder {
  color: var(--ink-dim);
}

.tools-search:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tools-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.tool-chip {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.tool-chip:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.tool-chip.active {
  color: #06110f;
  background: var(--accent);
  border-color: transparent;
}

/* Flex, not grid: every section is centered, and a grid leaves a short last row
   (2 projects, 1 product) stuck on the left. Wrapped rows center here. */
.tools-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.tool-card {
  flex: 0 1 320px;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 22px 20px;
  min-height: 176px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease, background 0.18s ease;
}

a.tool-card:hover {
  transform: translateY(-3px);
  background: var(--surface-2);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--accent-soft);
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  line-height: 1;
}

.tool-icon svg {
  width: 22px;
  height: 22px;
}

.tool-tag {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.tool-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.tool-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}

.tool-open {
  margin-top: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tool-open .arrow {
  transition: transform 0.18s ease;
}

a.tool-card:hover .tool-open .arrow {
  transform: translateX(4px);
}

.tool-card.soon {
  opacity: 0.6;
  cursor: default;
}

.tool-card.soon .tool-tag {
  color: var(--accent-2);
  border-color: var(--accent-soft);
}

.tools-empty {
  text-align: center;
  color: var(--ink-soft);
  font-size: 15px;
  padding: 24px 0;
}

/* ---------- accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- embed mode (?embed=1, set by site-mount.js) ---------- */
/* The tool alone inside another site's iframe: no header/footer/FAQ, compact spacing. */
.embed #siteHeader,
.embed .site-footer,
.embed .faq,
.embed .page-subtitle,
.embed .ir-hint:has(a[href^="#"]) { display: none; }
.embed body { background: var(--bg); }
.embed .main-content { padding: 12px 12px 8px; }
.embed .page-title { font-size: 20px; margin: 0 0 12px; }
.embed .embed-credit { text-align: center; font-size: 12.5px; margin: 10px 0 0; }
.embed .embed-credit a { color: var(--accent-2); }
