/* ==========================================================
   BASE.CSS — Paleta jurídica premium: azul-marinho + dourado + creme
   ========================================================== */

:root {
  /* Fundos claros (main content) */
  --bg-primary: #F4EDD8;          /* fundo do main (bege creme) */
  --bg-secondary: #FFFFFF;        /* cards */
  --bg-tertiary: #FAF5E4;         /* sub-cards / inputs */
  --bg-elevated: #FFFFFF;

  /* Tons escuros (sidebar, header escuro, e-mail) */
  --navy: #0F1B33;                /* azul-marinho principal */
  --navy-soft: #1A2746;
  --navy-deep: #0A1429;

  /* Bordas */
  --border: #E2D9BC;              /* bege mais escuro */
  --border-strong: #C9BB94;
  --border-dark: #1A2746;         /* pra bordas em fundo escuro */

  /* Textos sobre fundo claro */
  --text-primary: #0F1B33;        /* azul-marinho (texto principal) */
  --text-secondary: #5B6478;
  --text-tertiary: #8A8E9C;

  /* Textos sobre fundo escuro (sidebar) */
  --text-light: #F5F5F7;
  --text-light-dim: #A8B0C4;
  --text-light-faded: #6B7280;

  /* Acentos */
  --gold: #D4AF37;
  --gold-hover: #C9A332;
  --gold-soft: #E8C871;
  --gold-dim: #8A7220;

  --success: #10B981;
  --success-soft: #D1FAE5;
  --warning: #F59E0B;
  --warning-soft: #FEF3C7;
  --danger: #DC2626;
  --danger-soft: #FEE2E2;
  --info: #3B82F6;
  --info-soft: #DBEAFE;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-soft: 0 2px 8px rgba(15, 27, 51, 0.06);
  --shadow-medium: 0 4px 16px rgba(15, 27, 51, 0.10);
  --shadow-strong: 0 8px 28px rgba(15, 27, 51, 0.15);

  --transition: 180ms ease;
}

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

html, body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;        /* NUNCA scroll horizontal */
  max-width: 100vw;
  -webkit-text-size-adjust: 100%;
}

/* Imagens nunca estouram */
img, video, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Tabelas viram scroll horizontal dentro do wrapper, nunca quebra layout */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Inputs e textarea — nunca estouram do container */
input, select, textarea {
  max-width: 100%;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', 'Inter', serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 22px; line-height: 1.3; }
h3 { font-size: 18px; line-height: 1.4; font-family: 'Inter', sans-serif; font-weight: 600; }

p { color: var(--text-secondary); }

a { color: var(--gold-hover); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); text-decoration: underline; }

button, input, select, textarea {
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: all var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}
textarea { resize: vertical; min-height: 80px; }

button { cursor: pointer; border: none; }

/* ===== Tipografia auxiliar ===== */
.text-gold { color: var(--gold-hover); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-dim { color: var(--text-tertiary); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }

/* ===== Botões ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  border: 1px solid transparent;
  line-height: 1.4;
}
.btn-primary {
  background: var(--gold);
  color: var(--navy);
  font-weight: 600;
}
.btn-primary:hover { background: var(--gold-hover); transform: translateY(-1px); box-shadow: var(--shadow-medium); text-decoration: none; }

.btn-secondary {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold-hover); text-decoration: none; }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #B91C1C; text-decoration: none; }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; display: flex; }

/* ===== Alerts ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  border-left: 3px solid;
}
.alert-success { background: var(--success-soft); border-color: var(--success); color: #065F46; }
.alert-warning { background: var(--warning-soft); border-color: var(--warning); color: #92400E; }
.alert-danger  { background: var(--danger-soft);  border-color: var(--danger);  color: #991B1B; }
.alert-info    { background: var(--info-soft);    border-color: var(--info);    color: #1E40AF; }

/* ===== Login (mantém visual escuro premium para login) ===== */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--navy);
  background-image: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 100%);
  padding: 20px;
}
.login-card {
  background: #FFFFFF;
  padding: 40px;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  border-top: 3px solid var(--gold);
}
.login-brand { text-align: center; margin-bottom: 30px; }
.login-brand h1 {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.login-brand p {
  font-size: 11px;
  color: var(--gold-hover);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-top: 4px;
}

/* Campos */
.campo { margin-bottom: 16px; }
.campo label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.campo input, .campo select, .campo textarea {
  width: 100%;
}
.help {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}
