/* QuadroForce — os componentes do Design System 0.88.0 em CSS puro.
 *
 * Carregado SÓ pela porta e pelo coletor, depois de `/base.css` (tokens, fontes
 * e topo). Fica fora de `base.css` de propósito: o painel ainda carrega a base
 * e estes seletores (`body`, `label`, `input`, `.erro`, `.primario`…) mudariam a
 * cara dele antes de ele migrar para React. Quando o painel migrar, as duas
 * folhas podem se fundir.
 *
 * O que se reproduz do manifesto é a GEOMETRIA, os estados e o foco dos
 * componentes (Button, TextField, PasswordField, Card, Alert), lidos dos tokens:
 * nenhuma cor, tamanho de fonte, espaço, raio ou sombra é escrito à mão.
 */

* { box-sizing: border-box; }

html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-data);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

/* Todo número que é dado, em fonte monoespaçada e algarismos tabulares. */
.mono, .relogio {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

/* ── Foco visível, igual em tudo que se opera ─────────────────────────── */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ── Tipografia de página ──────────────────────────────────────────────── */
h1, h2 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; color: var(--text-primary); }
h1 { margin: 0; font-size: 2rem; }
h2 { margin: var(--space-6) 0 var(--space-3); font-size: 1.375rem; }

.rotulo { margin: 0; color: var(--text-secondary); font-size: 0.875rem; }
.destaque { margin: 0; font-weight: 600; }
.casa { margin: var(--space-1) 0 0; color: var(--text-secondary); font-size: 0.875rem; }
.eyebrow {
  margin: 0; color: var(--text-accent);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
}
.explicacao { margin: 0 0 var(--space-4); color: var(--text-primary); font-size: 0.875rem; line-height: 1.5; }

/* ── Button ────────────────────────────────────────────────────────────
   Corpo com brilho e sombra de queda (`--elevation-1`); pressionar encolhe;
   passar o mouse clareia. Alvo de toque de 48px: a regra da casa é "para
   quem está de mãos molhadas na cozinha", acima dos 44px do Design System.
   `.primario` é a ação principal da tela; `.secundario` é a de apoio;
   `.link` é o botão quieto (sem moldura até o hover). */
.primario, .secundario, .link {
  font: inherit; font-weight: 500; line-height: 1.2;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color .15s ease, scale .1s ease, box-shadow .15s ease;
}
.primario, .secundario {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: var(--space-3) var(--space-6);
  border: 0; border-radius: var(--radius-lg);
}
.primario {
  width: 100%; margin-top: var(--space-6);
  background: var(--fill-primary); color: var(--on-fill-primary);
  box-shadow: var(--elevation-1);
}
.primario:hover { background: var(--fill-primary-sheen); }
.primario:active { background: var(--fill-primary-press); scale: 0.98; box-shadow: var(--elevation-0); }
.secundario {
  background: var(--surface-card); color: var(--text-primary);
  box-shadow: var(--elevation-1);
}
.secundario:hover { background: var(--surface-hover); }
.secundario:active { scale: 0.98; box-shadow: var(--elevation-0); }
.primario:disabled, .secundario:disabled {
  background: var(--fill-disabled); color: var(--fill-disabled-on);
  box-shadow: none; cursor: not-allowed;
}
/* Botão de bater ponto / encerrar serviço: o maior alvo da tela. */
.grande {
  min-height: 72px; padding: var(--space-4) var(--space-6);
  font-size: 1.375rem; font-weight: 600; letter-spacing: 0.01em;
}
.link {
  display: inline-flex; align-items: center;
  min-height: 48px; padding: var(--space-1) var(--space-3);
  background: none; border: 0; border-radius: var(--radius-md);
  color: var(--text-accent); font-size: 0.875rem; text-decoration: underline;
  text-underline-offset: 3px;
}
.link:hover { background: var(--surface-hover); }
.link:active { scale: 0.97; }

/* ── TextField / PasswordField ─────────────────────────────────────────
   Campo afundado: poço com sombra interna, anel no foco. 16px no mínimo para o
   iOS não ampliar a tela ao focar (`--input-font-compact`). */
label {
  display: block; margin: var(--space-4) 0 var(--space-1);
  color: var(--text-secondary); font-size: 0.875rem; font-weight: 500;
}
input, textarea {
  width: 100%; min-height: 48px; padding: var(--space-3);
  background: var(--surface-sunken); color: var(--text-primary);
  border: 0; border-radius: var(--radius-md);
  box-shadow: var(--elevation-inset);
  font: inherit; font-size: var(--input-font-compact);
}
textarea { min-height: 6rem; resize: vertical; }
input:hover, textarea:hover { background: var(--surface-hover); }
input:focus, textarea:focus { background: var(--surface-card); outline: 2px solid var(--focus-ring); outline-offset: 1px; }
input::placeholder, textarea::placeholder { color: var(--text-secondary); opacity: 0.8; }
input:disabled, textarea:disabled { background: var(--fill-disabled); color: var(--fill-disabled-on); cursor: not-allowed; }

/* ── Alert ─────────────────────────────────────────────────────────────
   Faixa de aviso com disco de ícone. `.erro` é o tom de erro, `.aviso` o de
   atenção, `.alerta` o de atenção com peso (a senha foi redefinida por outra
   pessoa: a única superfície em que ela descobre isso). */
.erro, .aviso, .alerta, .lembrete {
  --sig: var(--scale-warning-9);
  --txt: var(--scale-warning-12);
  --tint: var(--scale-warning-3);
  --bd: var(--scale-warning-7);
  position: relative;
  display: block;
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4) var(--space-3) calc(var(--space-4) + 28px + var(--space-3));
  background: var(--tint); color: var(--txt);
  border: 1px solid var(--bd); border-radius: var(--radius-xl);
  font-size: 0.875rem; line-height: 1.45;
  box-shadow: var(--elevation-0);
}
.erro { --sig: var(--scale-danger-9); --txt: var(--scale-danger-12); --tint: var(--scale-danger-3); --bd: var(--scale-danger-7); }
.erro::before, .aviso::before, .alerta::before, .lembrete::before {
  content: "!";
  position: absolute; left: var(--space-4); top: var(--space-3);
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: var(--radius-full);
  background: var(--sig); color: var(--scale-warning-on);
  font-weight: 700; font-size: 1rem; line-height: 1;
}
.erro::before { color: var(--scale-danger-on); }
.alerta { font-size: 0.875rem; }
/* O aviso da empresa que é urgente herda o tom de atenção, sem o disco: ele é
   uma linha da lista, não uma faixa solta. */
li.alerta { padding-left: var(--space-4); }
li.alerta::before { content: none; }

/* A faixa de lembrete (senha provisória adiada) é o caminho de volta: alvo de
   toque cheio, largura total, e sempre à vista enquanto a pessoa trabalha. */
.lembrete {
  width: 100%; min-height: 48px; text-align: left; cursor: pointer;
  font-family: inherit; font-weight: 500;
}
.lembrete:hover { background: var(--scale-warning-4); }

/* ── Card ──────────────────────────────────────────────────────────────── */
.cartao, .recibo, .portao-desvio {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    scale: none !important;
  }
}

@media (prefers-contrast: more) {
  .primario, .secundario, input, textarea { outline: 2px solid var(--border-strong); }
}
