/*
 * Empire FM — páginas legais (Firebase Hosting, projeto empirefm-prod).
 * Um arquivo só, sem fontes externas, sem JS. As cores são os tokens do app
 * (lib/theme/tokens.dart): se o tema do app mudar, muda aqui também.
 */
:root {
  --surface: #0B0E14;
  --elevated: #151A24;
  --outline: #232A38;
  --accent: #E8A33D;
  --accent-pressed: #C9862A;
  --text: #F2F4F8;
  --muted: #9AA4B8;
  --measure: 46rem;
  color-scheme: dark;
}

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

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

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

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--text);
}

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

.skip {
  position: absolute;
  left: -999rem;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--elevated);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Cabeçalho ---------------------------------------------------------- */

.top {
  border-bottom: 1px solid var(--outline);
  background: var(--elevated);
}

.top .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.brand {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand span {
  color: var(--accent);
}

.langs {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.langs a {
  display: block;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--outline);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
}

.langs a:hover {
  color: var(--text);
  border-color: var(--muted);
}

.langs a[aria-current="true"] {
  color: var(--surface);
  background: var(--accent);
  border-color: var(--accent);
}

.docs {
  border-bottom: 1px solid var(--outline);
}

.docs ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0.6rem 0;
  list-style: none;
  font-size: 0.875rem;
}

.docs a {
  color: var(--muted);
  text-decoration: none;
}

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

.docs a[aria-current="page"] {
  box-shadow: 0 2px 0 var(--accent);
}

/* --- Conteúdo ----------------------------------------------------------- */

main {
  padding: 2.25rem 0 3rem;
}

h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h2 {
  margin: 2.4rem 0 0.6rem;
  padding-top: 0.2rem;
  font-size: 1.2rem;
  line-height: 1.3;
}

h3 {
  margin: 1.5rem 0 0.35rem;
  font-size: 1rem;
  color: var(--text);
}

p,
ul,
ol {
  margin: 0 0 0.9rem;
}

ul,
ol {
  padding-left: 1.3rem;
}

li {
  margin-bottom: 0.35rem;
}

li::marker {
  color: var(--accent);
}

strong {
  font-weight: 650;
}

.meta {
  color: var(--muted);
  font-size: 0.875rem;
}

.card {
  margin: 1.4rem 0;
  padding: 1rem 1.15rem;
  background: var(--elevated);
  border: 1px solid var(--outline);
  border-radius: 12px;
}

.card > :last-child {
  margin-bottom: 0;
}

.card h2,
.card h3 {
  margin-top: 0;
}

.warn {
  border-color: var(--accent);
}

.steps {
  counter-reset: step;
  padding: 0;
  list-style: none;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0.1rem 0 0.1rem 2.4rem;
  margin-bottom: 0.7rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--surface);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.7rem;
  text-align: center;
}

.path {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--outline);
  border-radius: 6px;
  background: var(--elevated);
  font-weight: 600;
}

.table {
  margin: 1rem 0 1.2rem;
  overflow-x: auto;
  border: 1px solid var(--outline);
  border-radius: 12px;
}

table {
  width: 100%;
  min-width: 30rem;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.5;
}

th,
td {
  padding: 0.65rem 0.8rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--outline);
}

thead th {
  background: var(--elevated);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tbody th {
  font-weight: 650;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.8rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

.tiles li {
  margin: 0;
}

.tiles a {
  display: block;
  height: 100%;
  padding: 1rem 1.1rem;
  background: var(--elevated);
  border: 1px solid var(--outline);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
}

.tiles a:hover {
  border-color: var(--accent);
}

.tiles strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--accent);
}

.tiles span {
  color: var(--muted);
  font-size: 0.875rem;
}

/* --- Rodapé ------------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--outline);
  padding: 1.4rem 0 2.2rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.foot p {
  margin: 0 0 0.3rem;
}

@media (max-width: 30rem) {
  main {
    padding-top: 1.6rem;
  }
}

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

@media print {
  :root {
    --surface: #fff;
    --elevated: #fff;
    --outline: #bbb;
    --accent: #7a4f00;
    --text: #000;
    --muted: #444;
    color-scheme: light;
  }

  .langs,
  .docs,
  .skip {
    display: none;
  }

  .table {
    overflow: visible;
  }
}
