/* AuthSafe site. Dark only, like the app (app.json userInterfaceStyle "dark"): every colour below is the app's
   palette from src/theme/theme.ts, so the site and the app read as one product. No inline styles, no external
   fonts; the only script is assets/store.js, which sets <html data-platform> for the store badges (and, on
   baixar.html, sends a phone to its store). */

:root {
  color-scheme: dark;

  --bg: #0B0D12;
  --surface: #15181F;
  --surface-raised: #1C2029;
  --text: #F2F2F2;
  --muted: #9AA0AB;
  --border: #262A33;
  --accent: #F2F2F2;
  --accent-pressed: #D6D8DC;
  --on-accent: #0B0D12;
  --success: #4CD787;
  --success-surface: rgba(76, 215, 135, 0.12);
  --warning: #FFB84D;
  --warning-surface: rgba(255, 184, 77, 0.10);
  /* why: links on near-black need a hue the app never uses for state, at >= 7:1 against --bg. */
  --link: #9CCBFA;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-tile: 12px;
  --max: 68rem;
  --narrow: 46rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

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

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-raised);
  padding: 0.1em 0.35em;
  border-radius: 6px;
  overflow-wrap: anywhere;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 720px) {
  .wrap { padding: 0 24px; }
}

.wrap-narrow { max-width: var(--narrow); }

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 20;
}

.skip-link:focus { top: 8px; }

/* ---------- icons: the app's glyphs, 24 grid, 1.75 stroke, round caps ---------- */

.i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 24px;
  row-gap: 4px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.4px;
}

/* invariant: the app icon is the white tile itself; the radius matches the home's brand tile. */
.brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-block;
  padding: 6px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--text); }

@media (max-width: 719px) {
  /* why: on a phone the nav wraps to a second line; a sticky two-line bar would eat the screen at 200 % zoom. */
  .site-header { position: static; }
  .site-nav { width: 100%; }
  .site-nav ul { gap: 0 16px; }
}

/* ---------- type ---------- */

h1, h2, h3 { line-height: 1.2; margin: 0; }

/* invariant: the app's large left title (28/800, -0.6 tracking), scaled up for a page. */
.title-xl {
  font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.title-lg {
  font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.6px;
}

.lead {
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.55;
  margin: 12px 0 0;
}

@media (min-width: 720px) {
  .lead { font-size: 1.1875rem; }
}

/* invariant: the Group label of the app: muted 13/600 above a surface. */
.kicker {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

/* ---------- buttons: the app's primary (light fill) and secondary (outline) ---------- */

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  text-align: left;
}

.button:hover { background: var(--accent-pressed); border-color: var(--accent-pressed); }
.button:active { transform: scale(0.98); }

.button-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.button-secondary:hover { background: var(--surface); border-color: var(--border); }

/* ---------- store badges: the official Apple and Google artwork, unmodified ---------- */

/* invariant: both badges show the same visible height (--badge-h). Apple's SVG has no padding; Google's PNG
   (646 x 250) has 29 px of transparent padding above and below a 192 px badge, so it is drawn 250/192 taller and
   pulled back by the padding with a negative margin. Google asks for its badge to be the same size or larger than
   the others; Apple asks for at least 40 px on screen; both ask for clear space of 1/4 of the height (12 px here). */
.stores {
  --badge-h: 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}

.store {
  display: inline-flex;
  align-items: center;
  height: var(--badge-h);
  border-radius: 8px;
}

.store img {
  width: auto;
  height: var(--badge-h);
  max-width: none;
}

.store-android img {
  height: calc(var(--badge-h) * 250 / 192);
  margin: calc(var(--badge-h) * -29 / 192) 0;
}

/* why: the small text link keeps the other store one tap away when store.js hides its badge. */
.store-alt {
  display: none;
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* hazard: Apple asks for the App Store badge to come first when several store badges appear together, so on a
   phone only the visitor's own badge is a badge and the other store is a text link. */
[data-platform="ios"] .stores-smart .store-android,
[data-platform="android"] .stores-smart .store-ios { display: none; }

[data-platform="ios"] .stores-smart .store-alt-android,
[data-platform="android"] .stores-smart .store-alt-ios { display: block; }

[data-platform="ios"] .stores-smart,
[data-platform="android"] .stores-smart { --badge-h: 56px; }

.closing .stores { justify-content: center; }

.trademarks { color: var(--muted); font-size: 0.8125rem; }

/* ---------- chips: the home's status chips ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 5px 16px 5px 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
}

.chip .tile {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.chip .i { width: 18px; height: 18px; }

/* a small tag beside a row title ("Recomendado", "Opcional") */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.tag-success { background: var(--success-surface); color: var(--success); }
.tag-warning { background: var(--warning-surface); color: var(--warning); }

/* ---------- icon tile (the GroupRow icon block) ---------- */

.tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-tile);
  background: var(--surface-raised);
  color: var(--text);
}

/* ---------- sections ---------- */

.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--border); }

@media (min-width: 720px) {
  .section { padding: 80px 0; }
}

.section-head { max-width: 40rem; margin-bottom: 32px; }

/* why: the rings are wider than the shots; sections clip them so the page never scrolls sideways. */
.hero,
.section { overflow-x: clip; }

/* ---------- hero ---------- */

.hero { padding: 40px 0 56px; }

.hero-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 900px) {
  .hero { padding: 72px 0 88px; }
  .hero-grid { grid-template-columns: 1.15fr 1fr; gap: 56px; }
}

.hero .lead { max-width: 34rem; }

/* ---------- phone shot with the app's rings ---------- */

.shot {
  position: relative;
  margin: 0 auto;
  width: min(100%, 290px);
  isolation: isolate;
}

.shot img {
  width: 100%;
  border-radius: 32px;
  border: 1px solid var(--border);
  background: var(--bg);
}

/* invariant: the Hero illustration's two concentric 1 px rings, drawn behind the screenshot. */
.shot::before,
.shot::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid var(--border);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
}

.shot::before { width: 165%; aspect-ratio: 1; opacity: 0.5; }
.shot::after { width: 128%; aspect-ratio: 1; }

.shot figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

/* ---------- group: one surface, hairlines between rows ---------- */

.group {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* invariant: the hairline starts at the content edge, like the account group's dividers. */
.group > li + li { border-top: 1px solid var(--border); margin-left: 16px; }
.group > li + li > .row { margin-left: -16px; }

.row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 56px;
  padding: 16px;
}

.row-text { flex: 1; min-width: 0; }

.row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
}

.row p {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 4px 0 0;
}

.step-num { font-weight: 800; font-size: 1rem; }

.group-label {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin: 0 0 8px 4px;
}

.split {
  display: grid;
  gap: 48px;
  align-items: start;
}

@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 290px; gap: 72px; align-items: center; }
}

.stack { display: grid; gap: 28px; }

/* ---------- feature cards ---------- */

.cards {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card h3 { font-size: 1.0625rem; font-weight: 700; margin: 14px 0 6px; }
.card p { color: var(--muted); font-size: 0.9375rem; line-height: 1.5; margin: 0; }

.shots-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.shots-pair .shot { width: 100%; }
.shots-pair .shot::before,
.shots-pair .shot::after { display: none; }
.shots-pair .shot img { border-radius: 22px; }

/* ---------- FAQ ---------- */

.faq {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.faq details + details { border-top: 1px solid var(--border); }

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 16px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { background: var(--surface-raised); }
.faq summary .i { color: var(--muted); transition: transform 0.15s ease; }
.faq details[open] summary .i { transform: rotate(180deg); }

.faq .answer { padding: 0 16px 16px; color: var(--muted); }
.faq .answer p,
.faq .answer ol,
.faq .answer ul { margin: 0 0 10px; }
.faq .answer > :last-child { margin-bottom: 0; }
.faq .answer li { margin: 4px 0; color: var(--muted); }
.faq .answer strong { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .faq summary .i { transition: none; }
}

.more { margin: 20px 0 0; color: var(--muted); }

/* ---------- closing call with the app's ring illustration ---------- */

.closing { text-align: center; }
.closing .lead { margin-left: auto; margin-right: auto; max-width: 30rem; }
.closing .button-row { justify-content: center; }

.rings {
  position: relative;
  width: 240px;
  height: 200px;
  margin: 0 auto 24px;
}

.rings .ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid var(--border);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.rings .ring-outer { width: 200px; height: 200px; opacity: 0.5; }
.rings .ring-inner { width: 144px; height: 144px; }

.rings .centre {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  border-radius: 30px;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rings .centre .i { width: 48px; height: 48px; }

.rings .sat {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rings .sat .i { width: 22px; height: 22px; }
.rings .sat-1 { left: 16px; top: 32px; transform: rotate(-8deg); }
.rings .sat-2 { right: 16px; top: 16px; transform: rotate(7deg); }
.rings .sat-3 { right: 40px; bottom: 8px; transform: rotate(-5deg); }

/* ---------- legal and help pages ---------- */

.page { padding: 32px 0 80px; }

@media (min-width: 720px) {
  .page { padding: 56px 0 96px; }
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
}

.back:hover { color: var(--text); }
.back .i { transform: rotate(180deg); width: 18px; height: 18px; }

.page h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.6px;
}

.updated { color: var(--muted); font-size: 0.9375rem; margin: 8px 0 0; }

.page h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin: 40px 0 10px;
}

.page p,
.page li { color: #D4D7DD; }
.page ul,
.page ol { padding-left: 1.25rem; }
.page li { margin: 6px 0; }
.page strong { color: var(--text); }
.page .lead { color: var(--muted); }
.page .row p { color: var(--muted); margin-top: 2px; }
.page .group { margin-top: 12px; }

.summary-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin: 28px 0 8px;
}

.summary-box p { margin: 0; }
.summary-box p + p { margin-top: 8px; }

.note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--warning-surface);
  border: 1px solid rgba(255, 184, 77, 0.35);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 20px 0;
}

.note .i { color: var(--warning); margin-top: 3px; }
.note p { margin: 0; color: var(--text); }

/* invariant: a value still to be filled before publishing; README "Antes de publicar" lists each one. */
.placeholder {
  background: var(--warning-surface);
  color: var(--warning);
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 600;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 48px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer .wrap { display: grid; gap: 24px; }

@media (min-width: 900px) {
  .site-footer .wrap { grid-template-columns: 1fr auto; align-items: start; }
}

.site-footer .brand { font-size: 1.125rem; }
.site-footer p { margin: 8px 0 0; }

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer ul a {
  display: inline-block;
  padding: 6px 0;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.site-footer ul a:hover,
.site-footer ul a[aria-current="page"] { color: var(--text); }
