/* ==========================================================================
   EFS Aplicativos — Páginas das versões web (ferramentas e jogos)
   Usa os tokens de site.css.
   ========================================================================== */

.nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-3);
}

/* ---------- Cabeçalho da página ---------- */
.page-head {
  max-width: 780px;
  padding: clamp(28px, 4vw, 48px) 0 clamp(20px, 3vw, 30px);
}
.page-head h1 {
  font-size: clamp(30px, 4vw, 46px);
  margin: 14px 0 12px;
}
.page-head p {
  margin: 0;
  color: var(--text-2);
  font-size: clamp(15px, 1.3vw, 17px);
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--muted);
}
.breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
}
.breadcrumb a {
  color: var(--text-2);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--violet-2);
}

/* ---------- Ferramenta ---------- */
.tool {
  padding: clamp(18px, 3vw, 30px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 32px);
  align-items: start;
}
.fields {
  display: grid;
  gap: 16px;
  margin: 0;
}
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.field > span,
.field > label,
.field > legend {
  padding: 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--text-2);
}
.field[hidden] {
  display: none;
}
.input-row {
  display: flex;
  gap: 8px;
}
.input,
.select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 14px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  transition: border-color 0.2s var(--ease);
}
.select {
  width: auto;
  flex: 0 0 auto;
  cursor: pointer;
}
.input::placeholder {
  color: var(--muted);
}
.input:hover,
.select:hover {
  border-color: var(--violet-2);
}
.input:focus-visible,
.select:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 1px;
}
.input[aria-invalid="true"] {
  border-color: #f97066;
}
.hint {
  font-size: 12.5px;
  color: var(--muted);
}
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Resultado ---------- */
.result {
  padding: 20px 22px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
}
.result-label {
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}
.result-value {
  margin: 4px 0 14px;
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.result-list {
  display: grid;
  gap: 8px;
  margin: 0;
}
.result-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.result-list dt {
  color: var(--muted);
}
.result-list dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}
.result-message {
  margin: 0;
  color: var(--text-2);
}
.result-message.error {
  color: #ffb4a8;
}
.level {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 700;
}
.level-ok {
  color: #86efac;
  background: rgba(34, 197, 94, 0.16);
}
.level-attention {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.16);
}
.level-alert {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.16);
}

/* ---------- Tabelas ---------- */
.table-title {
  margin: 26px 0 10px;
  font-size: 17px;
}
.table-wrap {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.data th,
.data td {
  padding: 10px 14px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.data th:first-child,
.data td:first-child {
  text-align: left;
}
.data thead th {
  position: sticky;
  top: 0;
  color: var(--text-2);
  background: var(--surface-2);
}
.data tr:last-child td {
  border-bottom: 0;
}
.data .current td {
  font-weight: 700;
  color: var(--text);
  background: rgba(59, 130, 246, 0.16);
}

/* ---------- Texto explicativo ---------- */
.texto {
  max-width: 780px;
  padding: 8px 0;
}
.texto h2 {
  margin: 44px 0 12px;
  font-size: clamp(22px, 2.4vw, 28px);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.texto h3 {
  margin: 26px 0 8px;
  font-size: 18px;
}
.texto p,
.texto li {
  color: var(--text-2);
}
.texto p {
  margin: 0 0 16px;
}
.texto ul,
.texto ol {
  margin: 0 0 18px;
  padding-left: 22px;
}
.texto li {
  margin-bottom: 8px;
}
.texto strong {
  color: var(--text);
}
.texto a {
  color: var(--blue-2);
}
.texto .table-wrap {
  max-height: none;
  margin: 0 0 18px;
}
.formula {
  margin: 0 0 16px;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 15px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.note {
  margin: 0 0 18px;
  padding: 14px 16px;
  font-size: 14.5px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--r-sm);
}

/* ---------- Convite para o app ---------- */
.cta-app {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 44px 0;
  padding: clamp(20px, 3vw, 28px);
  background: linear-gradient(135deg, #101a3d, #1b2a58);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  --text: #eef3ff;
  --text-2: #c3cdec;
}
.cta-app img {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: #fff;
}
.cta-app h2 {
  margin: 0 0 4px;
  font-size: 19px;
  color: var(--text);
  background: none;
}
.cta-app p {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
}
.cta-app .button {
  margin-left: auto;
  white-space: nowrap;
}

/* ---------- Grade das páginas de índice ---------- */
.app-body .card-title {
  margin: 12px 0 8px;
  font-size: 19px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
  background: none;
}
.card-title a {
  text-decoration: none;
}
.card-title a:hover {
  color: var(--violet-2);
}
.indice-atalhos {
  margin-top: 20px;
}
.indice-atalhos .filter {
  text-decoration: none;
}
.grupo {
  padding: 8px 0 clamp(28px, 4vw, 44px);
  scroll-margin-top: calc(var(--header-h) + 12px);
}

/* ---------- Contato ---------- */
.contact-email {
  overflow-wrap: anywhere;
}

/* ---------- Publicidade ----------
   Sempre separada por texto de qualquer botão, campo ou tabuleiro. */
.anuncio {
  margin: 48px 0;
}
.anuncio::before {
  content: "Publicidade";
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted);
}
.anuncio:has(ins[data-ad-status="unfilled"]) {
  display: none;
}
.anuncio-teste {
  display: grid;
  place-items: center;
  min-height: 250px;
  color: var(--muted);
  border: 2px dashed var(--border-2);
  border-radius: var(--r);
}
.anuncio-teste::before {
  display: none;
}

/* ---------- Tema claro ---------- */
:root[data-theme="light"] .result-message.error {
  color: #b42318;
}
:root[data-theme="light"] .level-ok {
  color: #166534;
}
:root[data-theme="light"] .level-attention {
  color: #92400e;
}
:root[data-theme="light"] .level-alert {
  color: #991b1b;
}
:root[data-theme="light"] .texto a {
  color: #2563eb;
}
:root[data-theme="light"] .data .current td {
  background: rgba(37, 99, 235, 0.12);
}

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .cta-app {
    flex-direction: column;
    align-items: flex-start;
  }
  .cta-app .button {
    margin-left: 0;
  }
}
