/* Tokens e elementos base. Paleta portada do legado (grafite + âmbar), sem Tailwind CDN: CSS puro, sem build. */
:root {
  --graphite: #0f172a;
  --graphite-800: #1e293b;
  --graphite-950: #0b1120;
  --primary: #f59e0b;
  --primary-dark: #d97706;
  --accent: #fb923c;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #1e293b;
  --text-muted: #64748b;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --warning-bg: #fffbeb;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 4px 16px rgb(15 23 42 / 6%);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

/* ---------- Botões e formulários ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.15s,
    box-shadow 0.15s;
}
.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--graphite);
  box-shadow: 0 8px 20px -8px rgb(245 158 11 / 55%);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-secondary:hover {
  background: var(--bg);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-link {
  background: none;
  border: none;
  padding: 4px 8px;
  color: var(--primary-dark);
  font-weight: 600;
  cursor: pointer;
}
.btn-link.danger {
  color: var(--danger);
}
.btn-block {
  width: 100%;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.field label {
  font-size: 14px;
  font-weight: 500;
}
.hint,
.field .hint {
  font-size: 12px;
  color: var(--text-muted);
}
.input,
select.input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  font: inherit;
  color: var(--text);
}
.input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(245 158 11 / 20%);
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

/* Checkbox com cara de interruptor (liga/desliga). */
.switch {
  appearance: none;
  flex: none;
  width: 40px;
  height: 22px;
  margin: 0;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 30%);
  transition: transform 0.15s;
}
.switch:checked {
  background: var(--success);
}
.switch:checked::after {
  transform: translateX(18px);
}
.switch:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
.switch:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-error,
.alert-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
}
.alert-warning {
  background: var(--warning-bg);
  color: #92400e;
  border: 1px solid #fde68a;
}
.alert-ok {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #bbf7d0;
}
.alert-banner .alert-link {
  display: block;
  margin-bottom: 8px;
  text-decoration: none;
}
.alert-banner .alert-link:hover {
  text-decoration: underline;
}
.alert-banner:not(:empty) {
  margin-bottom: 16px;
}

/* Marca (login e sidebar) */
.brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 12px 30px -8px rgb(245 158 11 / 60%);
  margin-bottom: 14px;
}
