@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,500;8..60,600;8..60,700&family=Public+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  /* ---- marca S&P (extraída dos documentos reais) ---- */
  --navy: #1B2A4A;
  --navy-ink: #12203A;
  --navy-soft: #2A3F63;
  --gold: #B08D45;
  --gold-ink: #8F701F;
  --gold-tint: #F3ECDC;
  --border: #DADFE5;
  --text-strong: #1A1A1A;
  --text-medium: #4A4A4A;
  --text-faint: #7A7A7A;
  --canvas: #F6F4EF;
  --surface: #FFFFFF;

  /* ---- disposições (funcional, não é o acento) ---- */
  --ok: #2F7D5B;
  --ok-bg: #E7F3EC;
  --slate: #5B6B85;
  --slate-bg: #EEF0F4;
  --amber: #C08A2E;
  --amber-bg: #FBF1DF;
  --terracotta: #B54B3B;
  --terracotta-bg: #FBEAE6;

  /* ---- tipografia ---- */
  --font-display: "Source Serif 4", Georgia, serif;
  --font-ui: "Public Sans", -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --type-display: 60px;
  --type-h1: 26px;
  --type-h2: 19px;
  --type-body: 16px;
  --type-sm: 14px;
  --type-xs: 12.5px;
  --type-mono-lg: 30px;
  --type-mono-md: 17px;

  /* ---- espaçamento ---- */
  --pad-xs: 4px;
  --pad-sm: 8px;
  --pad-md: 16px;
  --pad-lg: 24px;
  --pad-xl: 40px;
  --gap-sm: 8px;
  --gap-md: 16px;
  --gap-lg: 24px;

  --radius-card: 14px;
  --radius-input: 8px;
  --radius-chip: 999px;

  --shadow-card: 0 1px 2px rgba(20, 33, 58, .06), 0 10px 28px -14px rgba(20, 33, 58, .18);
  --shadow-sticky: 0 -6px 18px -10px rgba(20, 33, 58, .22);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-ui);
  color: var(--text-strong);
  background: var(--canvas);
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -5%, rgba(176, 141, 69, 0.05), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 10%, rgba(27, 42, 74, 0.04), transparent 55%);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); margin: 0; font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: var(--type-body); }

/* ---- faixa navy — o elemento-assinatura ---- */
.band {
  background: linear-gradient(155deg, var(--navy) 0%, var(--navy-ink) 100%);
  color: #fff;
  padding: var(--pad-lg) var(--pad-lg) var(--pad-md);
}
.band-eyebrow {
  font-size: var(--type-xs);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.62);
  font-weight: 600;
  margin-bottom: 6px;
}
.band h1, .band h2 { color: #fff; }

/* ---- cartão ---- */
.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.card .band { border-radius: var(--radius-card) var(--radius-card) 0 0; }
.card-body { padding: var(--pad-lg); }

/* ---- botões ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-input);
  padding: 14px 22px;
  font-size: var(--type-body);
  font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  min-height: 44px;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: var(--gold);
  color: #2A2109;
}
.btn-primary:hover { background: #C39B4F; }
.btn-primary:focus-visible { outline: 3px solid #8F701F55; outline-offset: 2px; }
.btn-primary:disabled { background: #E4D9BF; color: #A9A08A; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--navy); background: #F2F4F7; }
.btn-danger-ghost { background: transparent; color: var(--terracotta); border: 1.5px solid var(--terracotta-bg); }

/* ---- campos ---- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--pad-md); }
.field label { font-size: var(--type-sm); font-weight: 600; color: var(--text-medium); }
.field .hint { font-size: var(--type-xs); color: var(--text-faint); }
.field { min-width: 0; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  padding: 12px 14px;
  min-height: 44px;
  background: #fff;
  color: var(--text-strong);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--navy-soft);
  box-shadow: 0 0 0 3px rgba(27,42,74,.12);
}
.field input.invalid { border-color: var(--terracotta); background: #FFF9F8; }
.field .error { font-size: var(--type-xs); color: var(--terracotta); font-weight: 600; display: none; }
.field.has-error .error { display: block; }

/* ---- chips de disposição ---- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--type-xs);
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-chip);
  white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-slate { background: var(--slate-bg); color: var(--slate); }
.chip-amber { background: var(--amber-bg); color: var(--amber); }
.chip-terracotta { background: var(--terracotta-bg); color: var(--terracotta); }

/* ---- alerta inline (não bloqueante) ---- */
.alert {
  border-radius: var(--radius-input);
  padding: var(--pad-md);
  font-size: var(--type-sm);
  line-height: 1.5;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.alert-amber { background: var(--amber-bg); color: #6B4D1C; }
.alert-icon { flex-shrink: 0; margin-top: 1px; }

/* ---- utilitários ---- */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-medium); }
.faint { color: var(--text-faint); }
.autosave {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--type-xs); color: var(--text-faint);
  opacity: 0; transition: opacity .3s ease;
}
.autosave.show { opacity: 1; }
.autosave svg { color: var(--ok); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D3D8DF; border-radius: 8px; }
