/* ============================================================
 * Cartorária — Primitivas do Design System
 * ------------------------------------------------------------
 * Equivalente em CSS puro do `@layer components` de
 * `frontend/src/index.css` do Cartorária. Lá as classes são
 * escritas com @apply e o Tailwind as compila; aqui não há build
 * de CSS, então cada regra traz o valor que o Tailwind geraria.
 *
 * Ao mexer em qualquer coisa daqui, confira contra o utilitário
 * correspondente. A tabela de conversão que importa:
 *
 *   h-7 = 28px    h-9  = 36px    h-10 = 40px
 *   px-3 = 12px   px-4 = 16px    p-4  = 16px
 *   gap-2 = 8px   gap-3 = 12px
 *   rounded-lg = 8px   rounded-xl = 12px   rounded-2xl = 16px
 *   rounded-pill = 9999px
 *   tracking-tight = -0.025em   tracking-wide = 0.06em
 *   leading-tight  = 1.25       leading-snug   = 1.375
 *   font-medium = 500           font-semibold  = 600
 *
 * E duas armadilhas que já custaram caro:
 *   - a entrelinha do corpo é 1.5 (preflight), não 1.55;
 *   - `text-[36px]` define SÓ o tamanho — a entrelinha continua
 *     sendo a do corpo.
 * ============================================================ */

/* ── Base ──────────────────────────────────────────────────── */

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

html, body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--c-text);
}

/* Rótulo de seção — Inter em caixa-alta tracked (o nome vem do Cinzel,
   que era a fonte antes da v2.0 do design system). */
.cinzel {
  font-family: "Inter", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
}

.mono-label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10.5px;
  color: var(--c-text-muted);
}

/* Foco padronizado dourado */
*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ── Botões ────────────────────────────────────────────────── */
/* .btn-base: h-9 px-4 text-[13px] font-semibold tracking-wide rounded-lg */

.ds-btn-base {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; height: 36px; padding: 0 16px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
  font-family: inherit; border-radius: 8px;
  cursor: pointer; white-space: nowrap; user-select: none;
  text-decoration: none;
  transition: all 150ms var(--ease-sober);
}
.ds-btn-base:disabled { opacity: 0.5; cursor: not-allowed; }

/* .btn-sm: h-7 px-3 text-[12px] */
.ds-btn-sm { height: 28px; padding: 0 12px; font-size: 12px; }

/* ── Input ─────────────────────────────────────────────────── */
/* .input: w-full h-9 px-3 rounded-lg text-[13.5px], foco dourado */

.ds-input {
  width: 100%; height: 36px; padding: 8px 12px;
  background: var(--c-surface); color: var(--c-text);
  border: 1px solid var(--c-border); border-radius: 8px;
  font-size: 13.5px; font-family: inherit; outline: none;
  transition: all 150ms var(--ease-sober);
}
.ds-input::placeholder { color: var(--c-text-subtle); }
.ds-input:focus { border-color: var(--gold); box-shadow: var(--s-focus); }
/* .textarea: input + h-auto py-2 leading-snug */
.ds-textarea { height: auto; padding-top: 8px; padding-bottom: 8px;
               resize: vertical; line-height: 1.375; }

/* .btn-gold — ação primária sobre superfície clara (tela de login).
   Autossuficiente, como o `@apply btn-base …` do Cartorária: assim não
   precisa vir acompanhada de `.btn`, que é a variante preta desta
   aplicação e venceria por vir depois na cascata. O texto é SEMPRE
   --on-gold: regra §3.1 do design system. */
.btn-gold {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; height: 36px; padding: 0 16px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
  font-family: inherit; border-radius: 8px;
  cursor: pointer; white-space: nowrap; user-select: none;
  text-decoration: none;
  background: var(--gold); color: var(--on-gold); border: 1px solid var(--gold);
  transition: all 150ms var(--ease-sober);
}
.btn-gold:hover { background: var(--gold-deep); color: var(--paper); }
.btn-gold:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Linha decorativa ──────────────────────────────────────── */
.rule-soft { border-top: 1px solid var(--c-border-soft); }
.rule      { border-top: 1px solid var(--c-border); }

/* ── Badge ─────────────────────────────────────────────────── */
/* .badge: h-[22px] px-2.5 rounded-pill text-[11px] font-semibold tracking-wide */

.ds-badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 10px; border-radius: 9999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ── Card ──────────────────────────────────────────────────── */
/* Componente Card.tsx: rounded-2xl p-4 px-[18px] shadow-soft */

.card, .ds-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--s-soft);
  transition: all 150ms var(--ease-smooth);
}
.card-hover:hover, .ds-card-hover:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: var(--s-float);
}

/* ── Glass (launcher de módulos) ───────────────────────────── */
/* Cópia literal do .glass-card do Cartorária — lá também é CSS puro,
   porque backdrop-filter e cor via var() não têm utilitário nativo. */

.glass-card {
  background: var(--c-glass-bg);
  border: 1px solid var(--c-glass-border);
  border-radius: 20px;
  box-shadow: var(--s-glass);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  transition: transform .28s cubic-bezier(.22,1,.36,1),
              box-shadow .28s cubic-bezier(.22,1,.36,1),
              border-color .28s cubic-bezier(.22,1,.36,1),
              background .28s cubic-bezier(.22,1,.36,1);
  will-change: transform, box-shadow;
}
.glass-card-hover:hover,
.glass-card-hover:focus-visible {
  background: var(--c-glass-bg-hover);
  border-color: var(--c-glass-border-hover);
  box-shadow: var(--s-glass-hover);
  transform: translateY(-2px);
}
.glass-card-hover:active { transform: translateY(0) scale(.99); }

.launcher-canvas { background: var(--g-launcher-bg); min-height: 100vh; }
