/* Facilitei — site institucional (facilitei.ia.br)
   Um único arquivo: tokens → base → componentes → seções → página "abrir".
   Paleta: lib/core/theme/app_colors.dart. CSP: nada inline, sem imagens embutidas. */

/* ---------- Tokens (claro) ---------- */
:root {
  color-scheme: light dark;
  --bg: #FBFAF7;
  --bg-alt: #F1EFEA;
  --surface: #FFFFFF;
  --text: #1B1F1D;
  --muted: #4D5652;
  --line: #E4E0D7;
  --line-strong: #CFCAC0;

  --primary: #00A676;
  --primary-text: #007A57;          /* acessível sobre claro (5.1:1) */
  --primary-soft: #E2F4EC;
  --brand-btn: #007A57;
  --on-brand-btn: #FFFFFF;

  --action: #B3401F;                /* coral acessível (5.7:1 com branco) */
  --action-hover: #96341A;
  --on-action: #FFFFFF;
  --action-soft: #FFE8E0;
  --action-text: #B3401F;
  --action-shadow: rgba(179, 64, 31, .45);

  --warn-bg: #FDF1D6;
  --warn-line: #F0C76A;
  --warn-text: #5A3E00;
  --warn-ico-bg: #F5B945;
  --warn-ico: #3D2A00;

  --header-bg: rgba(251, 250, 247, .9);
  --hero-glow-1: rgba(78, 209, 162, .30);
  --hero-glow-2: rgba(245, 185, 69, .20);
  --band-from: #004D38;
  --band-to: #007F5A;

  --footer-bg: #13201B;
  --footer-text: #E8EDEB;
  --footer-muted: #A9B7B1;
  --footer-link: #8FE3C4;

  --focus: #007A57;
  --shadow-sm: 0 1px 2px rgba(27, 31, 29, .06), 0 2px 8px rgba(27, 31, 29, .05);
  --shadow-md: 0 2px 6px rgba(27, 31, 29, .05), 0 12px 32px -8px rgba(27, 31, 29, .14);

  --r-sm: 12px;
  --r: 16px;
  --r-lg: 20px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Tokens (escuro: azul-petróleo, sem preto puro) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1714;
    --bg-alt: #131E1B;
    --surface: #1A2421;
    --text: #E8EDEB;
    --muted: #A9B7B1;
    --line: #2A3935;
    --line-strong: #3A4D48;

    --primary-text: #4ED1A2;
    --primary-soft: rgba(78, 209, 162, .13);
    --brand-btn: #4ED1A2;
    --on-brand-btn: #0F1714;

    --action: #FF7A59;
    --action-hover: #FF9D85;
    --on-action: #1B1F1D;
    --action-soft: rgba(255, 122, 89, .14);
    --action-text: #FF9D85;
    --action-shadow: rgba(255, 122, 89, .25);

    --warn-bg: #2A2414;
    --warn-line: #6B5420;
    --warn-text: #F5D58A;
    --warn-ico-bg: #F5B945;
    --warn-ico: #2A1D00;

    --header-bg: rgba(15, 23, 20, .88);
    --hero-glow-1: rgba(0, 166, 118, .22);
    --hero-glow-2: rgba(245, 185, 69, .08);
    --band-from: #0A3A2B;
    --band-to: #00664A;

    --footer-bg: #0A110E;

    --focus: #4ED1A2;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, .25), 0 14px 32px -10px rgba(0, 0, 0, .5);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--primary-text); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 700; }
/* Compensa o cabeçalho fixo em âncoras e também ao focar com Tab. */
html { scroll-padding-top: 84px; }
main:focus { outline: none; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.i {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
.wrap-narrow { max-width: 820px; }

.skip {
  position: absolute;
  left: 16px;
  top: -200px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--r-sm);
  background: var(--brand-btn);
  color: var(--on-brand-btn);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 48px;
  padding: .75rem 1.25rem;
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn-sm { min-height: 44px; padding: .5rem 1rem; font-size: .95rem; }
.btn-lg { min-height: 52px; padding: .85rem 1.5rem; font-size: 1.05rem; }

.btn-action { background: var(--action); color: var(--on-action); box-shadow: 0 8px 20px -8px var(--action-shadow); }
.btn-action:hover { background: var(--action-hover); box-shadow: 0 12px 24px -8px var(--action-shadow); }
.btn-brand { background: var(--brand-btn); color: var(--on-brand-btn); }
.btn-brand:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); color: var(--primary-text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--primary-text); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.actions .btn { flex: 1 1 100%; }

/* ---------- Faixa de aviso (topo) ---------- */
.strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin: 0;
  padding: 10px 16px;
  background: var(--warn-bg);
  color: var(--warn-text);
  border-bottom: 1px solid var(--warn-line);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}
.strip .i { width: 1.15rem; height: 1.15rem; }
.strip span { text-wrap: balance; }

/* ---------- Cabeçalho ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
}
.header-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-height: 64px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-right: auto;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.02em;
  text-decoration: none;
}
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.top-nav { display: none; }

/* ---------- Seções ---------- */
.section { padding-block: 56px; }
.section-tight { padding-block: 24px; }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: 32px; text-align: center; }
.section-head h2, .audience-head h2 { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.25rem); font-weight: 800; letter-spacing: -.02em; }
h3 { font-size: 1.1rem; font-weight: 700; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: 40px 32px;
  background:
    radial-gradient(52rem 28rem at 100% -10%, var(--hero-glow-1), transparent 62%),
    radial-gradient(34rem 20rem at -12% 45%, var(--hero-glow-2), transparent 62%),
    var(--bg);
  overflow: hidden;
}
.hero-in { display: grid; gap: 32px; align-items: center; }
.hero h1 {
  font-size: clamp(2.1rem, 1.4rem + 3.6vw, 3.6rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.hero h1 .accent { color: var(--primary-text); }
.hero-sub { margin-top: 18px; max-width: 36rem; color: var(--muted); font-size: 1.125rem; }
.hero .actions { margin-top: 28px; }
.micro { margin-top: 14px; max-width: 34rem; color: var(--muted); font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: .875rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.chips .i { width: 1rem; height: 1rem; color: var(--primary-text); }
.hero-art { justify-self: center; width: 100%; max-width: 480px; }
.hero-art img { width: 100%; height: auto; }

/* ---------- Aviso de testes (bloco) ---------- */
.notice {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px 14px;
  padding: 20px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: var(--r-lg);
}
/* No celular o ícone fica ao lado do título e o texto usa a largura toda. */
.notice > div { display: contents; }
.notice p { grid-column: 1 / -1; }
.notice h2 { color: var(--warn-text); font-size: 1.25rem; font-weight: 800; }
.notice p { color: var(--text); }
.notice a { color: var(--warn-text); font-weight: 600; }
.notice-ico {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--warn-ico-bg);
  color: var(--warn-ico);
}

/* ---------- Benefícios (duas colunas) ---------- */
.audiences { display: grid; gap: 20px; }
.audience {
  position: relative;
  padding: 24px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.audience::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #007F5A, #00A676, #4ED1A2);
}
.audience-pro::before { background: linear-gradient(90deg, #FF7A59, #F5B945); }
.audience-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.audience-head h2 { font-size: clamp(1.4rem, 1.2rem + 1vw, 1.75rem); }
.badge {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #007F5A, #00A676 55%, #4ED1A2);
  color: #FFFFFF;
}
.audience-pro .badge { background: linear-gradient(135deg, #FF7A59, #F5B945); color: #3D2A00; }
.badge .i { width: 26px; height: 26px; }

.features { display: grid; gap: 18px; }
.feature { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.feature h3 { font-size: 1.05rem; margin-bottom: 2px; }
.feature p, .card p, .step p { color: var(--muted); }

.ico {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--primary-soft);
  color: var(--primary-text);
}
.audience-pro .ico { background: var(--action-soft); color: var(--action-text); }
.ico-lg { width: 52px; height: 52px; border-radius: 16px; }
.ico-lg .i { width: 26px; height: 26px; }

.support {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 760px;
  margin: 28px auto 0;
  padding: 14px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r);
  color: var(--text);
  font-weight: 600;
}
.support .i { color: var(--primary-text); width: 1.5rem; height: 1.5rem; }

/* ---------- Como funciona ---------- */
.steps { display: grid; gap: 16px; counter-reset: passo; }
.step {
  position: relative;
  padding: 24px 20px 24px calc(38px + 2.875rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  counter-increment: passo;
}
.step::before {
  content: counter(passo);
  position: absolute;
  left: 20px;
  top: 22px;
  display: grid;
  place-items: center;
  width: 2.875rem;
  height: 2.875rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #005C42, #007F5A);
  color: #FFFFFF;
  font-size: 1.3rem;
  font-weight: 800;
}
.step h3 { margin-bottom: 6px; font-size: 1.15rem; }

/* ---------- Segurança ---------- */
.trust { display: grid; gap: 16px; }
.card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card h3 { margin: 16px 0 6px; font-size: 1.15rem; }

/* ---------- Download (faixa com gradiente) ---------- */
.band {
  position: relative;
  display: grid;
  gap: 28px;
  padding: 32px 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--band-from), var(--band-to));
  color: #FFFFFF;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  isolation: isolate;
}
.band::before, .band::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .12);
}
.band::before { width: 340px; height: 340px; right: -120px; top: -140px; }
.band::after { width: 220px; height: 220px; left: -90px; bottom: -110px; }
.band h2 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); font-weight: 800; letter-spacing: -.02em; }
.band-intro p { margin: 12px 0 24px; font-size: 1.075rem; max-width: 30rem; }
.band-intro .btn { width: 100%; }
.band a:not(.btn) { color: #FFFFFF; }
.band :focus-visible { outline-color: #FFFFFF; }
.band-steps-title { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.install { display: grid; gap: 12px; counter-reset: inst; }
.install li {
  position: relative;
  padding: 16px 16px 16px calc(30px + 2.125rem);
  border-radius: var(--r);
  background: rgba(0, 30, 21, .32);
  border: 1px solid rgba(255, 255, 255, .14);
  counter-increment: inst;
}
.install li::before {
  content: counter(inst);
  position: absolute;
  left: 16px;
  top: 16px;
  display: grid;
  place-items: center;
  width: 2.125rem;
  height: 2.125rem;
  border-radius: 50%;
  background: #FFFFFF;
  color: #005C42;
  font-weight: 800;
}
.install strong { display: block; margin-bottom: 2px; font-size: 1.05rem; }
.band-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: .925rem; }
.band-note .i { margin-top: 2px; }

/* ---------- Perguntas frequentes ---------- */
.faq { display: grid; gap: 12px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s ease;
}
.faq details[open] { border-color: var(--primary-text); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 14px 20px;
  border-radius: var(--r);
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border-right: 2.5px solid var(--primary-text);
  border-bottom: 2.5px solid var(--primary-text);
  transform: translateY(-3px) rotate(45deg);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq summary:hover { color: var(--primary-text); }
.faq details p { padding: 0 20px 20px; color: var(--muted); }

/* ---------- Rodapé ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-text); padding-top: 48px; }
.footer-in { display: grid; gap: 32px; }
.brand-light { color: var(--footer-text); }
.footer-brand p { margin-top: 10px; color: var(--footer-muted); max-width: 22rem; }
.footer-title { margin-bottom: 8px; color: var(--footer-text); font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
/* Colunas em rem: com fonte ampliada (ex.: tamanho de fonte do Android) viram uma só. */
.footer-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 8rem), 1fr)); column-gap: 16px; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--footer-link);
  text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; }
.footer-contact { grid-template-columns: 1fr; gap: 6px; }
.footer-contact a { overflow-wrap: anywhere; }
.footer-contact li { display: flex; flex-direction: column; }
.footer-contact span { color: var(--footer-muted); font-size: .875rem; }
.footer-contact a { padding-block: 2px; }
.site-footer :focus-visible { outline-color: var(--footer-link); }
.footer-bottom { margin-top: 32px; padding-bottom: 20px; color: var(--footer-muted); font-size: .875rem; }
.footer-bottom p { padding-top: 20px; border-top: 1px solid rgba(232, 237, 235, .14); }

/* ---------- Página "Abrir no app" ---------- */
.page-open { min-height: 100vh; display: flex; flex-direction: column; }
.page-open .open-main {
  flex: 1;
  padding-block: 40px;
  background:
    radial-gradient(40rem 22rem at 100% 0, var(--hero-glow-1), transparent 62%),
    radial-gradient(30rem 20rem at 0 100%, var(--hero-glow-2), transparent 60%),
    var(--bg);
}
.open-card {
  max-width: 520px;
  margin-inline: auto;
  padding: 32px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.open-ico {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, #007F5A, #00A676 55%, #4ED1A2);
  color: #FFFFFF;
}
.open-ico .i { width: 30px; height: 30px; }
.open-card h1 { font-size: clamp(1.6rem, 1.3rem + 1.5vw, 2rem); font-weight: 800; letter-spacing: -.02em; }
.open-lead { margin-top: 10px; color: var(--muted); font-size: 1.075rem; }
.actions-stack { margin-top: 28px; }
.open-hint {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 24px;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--primary-soft);
  color: var(--text);
  font-size: .925rem;
  text-align: left;
}
.open-hint .i { margin-top: 2px; color: var(--primary-text); }
.open-footer { padding: 20px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; text-align: center; }

/* ---------- Telas maiores ---------- */
@media (min-width: 640px) {
  .wrap { padding-inline: 24px; }
  .actions .btn { flex: 0 0 auto; }
  .actions-stack .btn { flex: 1 1 100%; }
  .notice { padding: 24px 28px; gap: 20px; align-items: start; }
  .notice > div { display: block; }
  .notice h2 { margin-bottom: 6px; }
  .audience { padding: 32px 28px; }
  .band { padding: 40px 36px; }
  .band-intro .btn { width: auto; }
  .open-card { padding: 40px 36px; }
  .footer-in { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
}

@media (min-width: 900px) {
  .top-nav { display: flex; gap: 4px; margin-right: 8px; }
  .top-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease;
  }
  .top-nav a:hover { background: var(--primary-soft); color: var(--primary-text); }
  .section { padding-block: 88px; }
  .section-tight { padding-block: 32px; }
  .section-head { margin-bottom: 44px; }
  .hero { padding-block: 72px 64px; }
  .hero-in { grid-template-columns: 1.1fr .9fr; gap: 48px; }
  .hero-art { justify-self: end; }
  .audiences { grid-template-columns: 1fr 1fr; gap: 24px; }
  .steps, .trust { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .step { padding: calc(46px + 2.875rem) 24px 28px; }
  .step::before { left: 24px; top: 28px; }
  .band { grid-template-columns: .9fr 1.1fr; gap: 48px; padding: 56px; align-items: center; }
}

/* ---------- Movimento ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .hero-art img { animation: flutua 7s ease-in-out infinite; }
  @keyframes flutua {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .btn:hover, .card:hover { transform: none; }
}
