/* Conferi — variáveis e estilos compartilhados
 * Herdado do Holanda JL com renomeação de --orange → --primary (tenant-overridable). */

:root {
  --bg:      #f4f6fb;
  --surf:    #ffffff;
  --surf2:   #eef1f8;
  --bord:    #d8dff0;
  --primary: #f5820a;
  --header-color: #1a4fa8;  /* sobrescrito por tenant.branding.headerColor */
  --accent-color: #f5820a;  /* sobrescrito por tenant.branding.accentColor */
  --blue:    #1a4fa8;
  --green:   #18a85a;
  --red:     #d93535;
  --text:    #1a2340;
  --muted:   #6b7da0;

  --ff: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fm: 'Nunito', sans-serif;
  --fc: 'JetBrains Mono', ui-monospace, monospace;

  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

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

a { color: var(--primary); }

.btn-p {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-family: var(--ff);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.2s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  min-height: 44px;
}
.btn-p:hover  { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,.06); }
.btn-p:active { transform: translateY(0); }
.btn-p:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.err-banner {
  background: #fee;
  color: var(--red);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  display: none;
}
.err-banner.show { display: block; }

.muted { color: var(--muted); }

/* ---- Loading spinner (utilitário global) ---- */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(26, 79, 168, .15);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
.spinner.lg { width: 28px; height: 28px; border-width: 3px; }
.spinner.on-primary { border-color: rgba(255,255,255,.3); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 16px;
  color: var(--muted);
  font-size: 13px;
}

/* ---- Empty state (utilitário global) ---- */
.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--muted);
}
.empty-state-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 10px;
  opacity: .55;
}
.empty-state-title {
  font-family: var(--fm);
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}
.empty-state-text {
  font-size: 13px;
  line-height: 1.5;
  max-width: 320px;
  margin: 0 auto;
}

/* ---- Focus ring acessível ---- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---- Reduce motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Billing banner (avisos de cobrança no topo das telas internas) ---- */
:root {
  --warn:    #b8740a;
  --warn-bg: #fff4dc;
  --warn-bd: #f3c87a;
  --info:    #1a4fa8;
  --info-bg: #e8efff;
  --info-bd: #b7c8ee;
  --error:   var(--red);
  --error-bg: #fde8e8;
  --error-bd: #f0a8a8;
}

.billing-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  border-bottom: 1px solid transparent;
  font-size: 14px;
  line-height: 1.4;
}
.billing-banner.warn  { background: var(--warn-bg);  color: var(--warn);  border-bottom-color: var(--warn-bd); }
.billing-banner.info  { background: var(--info-bg);  color: var(--info);  border-bottom-color: var(--info-bd); }
.billing-banner.error { background: var(--error-bg); color: var(--error); border-bottom-color: var(--error-bd); }

.billing-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.billing-banner-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
.billing-banner-msg {
  flex: 1 1 240px;
  font-weight: 500;
}
.billing-banner-cta {
  background: currentColor;
  color: #fff !important;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  transition: opacity .15s ease;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
.billing-banner-cta:hover { opacity: .9; }
.billing-banner-close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  opacity: .6;
  transition: opacity .15s ease;
  min-height: 32px;
  min-width: 32px;
}
.billing-banner-close:hover { opacity: 1; }

@media (max-width: 768px) {
  .billing-banner-inner {
    padding: 10px 12px;
    gap: 8px;
  }
  .billing-banner-msg { flex-basis: 100%; order: 2; }
  .billing-banner-icon { order: 1; }
  .billing-banner-cta { order: 3; }
  .billing-banner-close { order: 4; margin-left: auto; }
}
