/* =============================================================
   ADS4PROS Design System v2 — shared stylesheet
   Source of truth: ADS4PROS-Site/docs/DESIGN_SYSTEM_V2.md (2026-05-12)
   Filosofia: identidade azul fria + ação laranja quente.
   Display 400-500 em 56-115px. Space Grotesk + JetBrains Mono.
   ============================================================= */

/* ----------------------------- 1. Tokens ----------------------------- */
:root {
  /* Brand — Azul ADS4PROS */
  --brand-50:   #e8f1fc;
  --brand-100:  #bcd5f5;
  --brand-300:  #3585e0;
  --brand-500:  #0a6ad8;
  --brand-700:  #0a3d7a;
  --brand-900:  #01122c;

  /* Detail — Laranja como ação/tempero (nunca identidade) */
  --detail:       #d97706;
  --detail-2:     #b45309;
  --detail-warm:  #e8830b;

  /* Surfaces */
  --ink:    #01122c;
  --ink-2:  #061b3a;
  --ink-3:  #0a2647;
  --paper:    #f6f7f9;
  --paper-2:  #eef0f4;
  --paper-3:  #dee2ea;
  --line:      #cbd2dc;
  --line-dark: rgba(255, 255, 255, 0.12);

  /* Steel — cinza-azulado */
  --steel-100: #c8cdd4;
  --steel-300: #8a93a0;
  --steel-500: #5b6470;
  --steel-700: #3a414c;
  --steel-900: #1c2128;

  /* Foreground */
  --fg:        #01122c;
  --fg-dim:    #3a414c;
  --fg-dimmer: #5b6470;

  /* Aliases legados (compat) */
  --accent:   #0a6ad8;
  --accent-2: #073060;
  --cyan:     #3585e0;
  --cyan-dim: #7fb5e8;

  /* Status semânticos (mantidos do painel) */
  --status-success: #02CB00;
  --status-warning: #d97706;
  --status-danger:  #b45309;

  /* Display scale */
  --font-display-xl: clamp(56px, 4rem + 4vw, 115px);
  --font-display-lg: clamp(40px, 3rem + 2.5vw, 88px);
  --font-display-md: clamp(32px, 2rem + 1.5vw, 64px);
  --font-display-sm: clamp(28px, 1.75rem + 1vw, 48px);

  /* Layout */
  --sidebar-w: 260px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  /* Fonts */
  --font-sans: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ----------------------------- 2. Reset / base ----------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--paper);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 17px;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; }

/* ----------------------------- 3. Utilities ----------------------------- */
.mono { font-family: var(--font-mono); letter-spacing: -0.01em; }
.tabular { font-variant-numeric: tabular-nums; }

/* Display headings — peso 400-500, tracking apertado. NUNCA bold. */
.display {
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 0.98;
  text-wrap: balance;
}
.display-medium {
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.02;
  text-wrap: balance;
}
.text-display-xl { font-size: var(--font-display-xl); }
.text-display-lg { font-size: var(--font-display-lg); }
.text-display-md { font-size: var(--font-display-md); }
.text-display-sm { font-size: var(--font-display-sm); }

/* Kicker — pequena linha mono uppercase com hífen decorativo */
.kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.kicker::before {
  content: '';
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

/* Eyebrow chip — azure label + laranja border (assinatura) */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-300);
  padding: 6px 10px;
  border: 1px solid rgba(217, 119, 6, 0.38);
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.05);
}

/* Label mono — forms e stats */
.label-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--steel-500);
  display: block;
  margin-bottom: 6px;
}

/* ----------------------------- 4. Gradients assinatura ----------------------------- */
.bg-gradient-brand {
  background: linear-gradient(135deg, #01122c 0%, #0a3d7a 40%, #0a6ad8 100%);
}
.bg-gradient-brand-radial {
  background:
    radial-gradient(900px 500px at 90% 5%, rgba(53,133,224,0.18), transparent 60%),
    radial-gradient(700px 400px at 10% 95%, rgba(217,119,6,0.14), transparent 60%),
    radial-gradient(ellipse at 20% 80%, #0a6ad8 0%, #0a3d7a 40%, #01122c 100%);
}
.bg-gradient-brand-subtle {
  background: linear-gradient(160deg, #01122c 0%, #073060 50%, #0a3d7a 100%);
}

/* ----------------------------- 5. Animations ----------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

@keyframes a4p-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ----------------------------- 6. Botões ----------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease,
              border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* CTA principal — LARANJA (ação quente sobre identidade fria) */
.btn-primary {
  background: var(--detail);
  color: #18120a;
  box-shadow: 0 0 0 1px var(--detail-2), 0 1px 0 rgba(0,0,0,0.1),
              0 6px 20px -8px rgba(217, 119, 6, 0.5);
}
.btn-primary:hover {
  background: var(--detail-warm);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px var(--detail-2), 0 2px 0 rgba(0,0,0,0.15),
              0 12px 28px -10px rgba(217, 119, 6, 0.55);
}

/* Sobre fundo escuro */
.btn-ghost-dark {
  color: #e8ecf1;
  border-color: rgba(255,255,255,0.18);
  background: transparent;
}
.btn-ghost-dark:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.32);
}

/* Sobre fundo claro */
.btn-ghost-light {
  color: var(--fg);
  border-color: var(--line);
  background: transparent;
}
.btn-ghost-light:hover {
  background: rgba(0,0,0,0.03);
  border-color: var(--steel-300);
}

/* Variante destrutiva (delete) */
.btn-danger {
  background: transparent;
  color: var(--detail-2);
  border-color: rgba(180, 83, 9, 0.4);
}
.btn-danger:hover {
  background: rgba(180, 83, 9, 0.08);
  border-color: var(--detail-2);
}

/* ----------------------------- 7. Shell sidebar (light) ----------------------------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  background: var(--paper);
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--paper-3);
  padding: 28px 18px;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 18px;
  border-bottom: 1px solid var(--paper-3);
}
.sidebar-brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--brand-500);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 600; font-size: 14px;
  letter-spacing: -0.02em;
}
.sidebar-brand-text {
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: -0.01em;
  font-size: 15px;
  color: var(--fg);
}
.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel-500);
  padding: 0 10px;
  margin-bottom: 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--fg-dim);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-link:hover { background: var(--paper-2); color: var(--fg); }
.sidebar-link.active {
  background: var(--brand-50);
  color: var(--brand-500);
}

.shell-main {
  padding: 28px 32px 40px;
  min-width: 0;
}
.shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 22px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--paper-3);
}
.shell-header h1 {
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-size: clamp(24px, 1.5rem + 0.5vw, 32px);
  color: var(--fg);
}

/* ----------------------------- 8. Card / surface ----------------------------- */
.card {
  background: #fff;
  border: 1px solid var(--paper-3);
  border-radius: var(--radius-md);
  padding: 22px;
}
.card-dark {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-md);
  padding: 22px;
  backdrop-filter: blur(12px);
}

/* ----------------------------- 9. Forms ----------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input, .select, .textarea {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--fg);
  background: #fff;
  border: 1px solid var(--paper-3);
  border-radius: 6px;
  padding: 10px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(10,106,216,0.15);
}
.input-dark, .select-dark, .textarea-dark {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line-dark);
  color: #fff;
}
.input-dark::placeholder { color: rgba(255,255,255,0.5); }

/* ----------------------------- 10. Table editorial (DataRow) ----------------------------- */
.data-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--brand-100);
}
.data-row:first-child { border-top-width: 2px; }

/* ----------------------------- 11. Banner modo demo ----------------------------- */
.demo-banner {
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.38);
  color: var(--detail-2);
  padding: 10px 14px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 16px;
}

/* ----------------------------- 12. Toast ----------------------------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(1,18,44,0.4);
  z-index: 9999;
  animation: a4p-fade-up 0.25s ease;
}
.toast-success { background: var(--brand-500); }
.toast-error   { background: var(--detail-2); }

/* ----------------------------- 13. Helpers ----------------------------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

/* Responsive */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--paper-3);
  }
  .shell-main { padding: 20px; }
}
