/* ============================================================
   VEXMOBI CRM — Design System Premium
   Dark Theme | Playfair Display + Inter | Gold Accents
   ============================================================ */

:root {
  --bg-primary:    #0a0b0e;
  --bg-secondary:  #111318;
  --bg-card:       #161920;
  --bg-hover:      #1e2128;
  --border:        #2a2d36;
  --gold:          #c9a84c;
  --gold-light:    #e2c47a;
  --gold-dark:     #a07c30;
  --text-primary:  #f0ede8;
  --text-secondary:#9ca3af;
  --text-muted:    #6b7280;
  --blue:          #3b82f6;
  --green:         #10b981;
  --red:           #ef4444;
  --yellow:        #f59e0b;
  --purple:        #8b5cf6;
  --orange:        #f97316;
  --sidebar-w:     256px;
  --radius:        8px;
  --radius-lg:     12px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --transition:    all 0.2s cubic-bezier(0.23,1,0.32,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── Layout ─────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
}

.page-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 36px;
}

/* ─── Sidebar ─────────────────────────────────────────────── */
.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  flex-direction: column;
}

.logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.logo-sub {
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 400;
  transition: var(--transition);
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(201,168,76,0.12);
  color: var(--gold);
  font-weight: 500;
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600;
  color: #000;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.logout-btn {
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--radius);
  transition: var(--transition);
  display: flex;
}

.logout-btn:hover { color: var(--red); background: rgba(239,68,68,0.1); }

/* ─── Page Header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.page-header-left .page-label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #000;
  font-weight: 600;
}

.btn-gold:hover { background: linear-gradient(135deg, var(--gold), var(--gold-light)); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover { border-color: var(--gold); color: var(--gold); background: rgba(201,168,76,0.05); }

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.3);
}

.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-icon { padding: 7px; }

/* ─── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ─── KPI Cards ───────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
}

.kpi-card:hover { border-color: rgba(201,168,76,0.3); }

.kpi-icon {
  width: 36px; height: 36px;
  background: rgba(201,168,76,0.12);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  margin-bottom: 12px;
}

.kpi-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--gold);
  margin-top: 2px;
}

/* ─── Tables ──────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--bg-secondary);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 13px 16px;
  font-size: 0.85rem;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(42,45,54,0.5);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr {
  transition: var(--transition);
}

tbody tr:hover { background: var(--bg-hover); }

/* ─── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.badge-lead        { background: rgba(107,114,128,0.2); color: #9ca3af; border-color: rgba(107,114,128,0.3); }
.badge-qualificado { background: rgba(59,130,246,0.2);  color: #60a5fa; border-color: rgba(59,130,246,0.3); }
.badge-convidado   { background: rgba(139,92,246,0.2);  color: #a78bfa; border-color: rgba(139,92,246,0.3); }
.badge-presente    { background: rgba(245,158,11,0.2);  color: #fbbf24; border-color: rgba(245,158,11,0.3); }
.badge-proposta    { background: rgba(249,115,22,0.2);  color: #fb923c; border-color: rgba(249,115,22,0.3); }
.badge-fechado     { background: rgba(16,185,129,0.2);  color: #34d399; border-color: rgba(16,185,129,0.3); }

.badge-ativo       { background: rgba(16,185,129,0.2);  color: #34d399; border-color: rgba(16,185,129,0.3); }
.badge-inativo     { background: rgba(107,114,128,0.2); color: #9ca3af; border-color: rgba(107,114,128,0.3); }
.badge-confirmado  { background: rgba(59,130,246,0.2);  color: #60a5fa; border-color: rgba(59,130,246,0.3); }
.badge-realizado   { background: rgba(16,185,129,0.2);  color: #34d399; border-color: rgba(16,185,129,0.3); }
.badge-cancelado   { background: rgba(239,68,68,0.2);   color: #f87171; border-color: rgba(239,68,68,0.3); }
.badge-orcamento   { background: rgba(245,158,11,0.2);  color: #fbbf24; border-color: rgba(245,158,11,0.3); }
.badge-planejamento{ background: rgba(107,114,128,0.2); color: #9ca3af; border-color: rgba(107,114,128,0.3); }
.badge-assinado    { background: rgba(16,185,129,0.2);  color: #34d399; border-color: rgba(16,185,129,0.3); }
.badge-pendente    { background: rgba(245,158,11,0.2);  color: #fbbf24; border-color: rgba(245,158,11,0.3); }
.badge-enviado     { background: rgba(59,130,246,0.2);  color: #60a5fa; border-color: rgba(59,130,246,0.3); }

/* ─── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control { cursor: pointer; }

textarea.form-control { resize: vertical; min-height: 80px; }

.form-grid { display: grid; gap: 16px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ─── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.23,1,0.32,1);
}

.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px;
  border-radius: var(--radius);
  transition: var(--transition);
}

.modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }

.modal-body { padding: 20px 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ─── Search & Filters ────────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input i {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px; height: 16px;
}

.search-input input {
  padding-left: 34px;
}

/* ─── Kanban ──────────────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 500px;
}

.kanban-col {
  flex-shrink: 0;
  width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}

.kanban-col-header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-col-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kanban-count {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.kanban-cards {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.kanban-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.kanban-card:hover {
  border-color: rgba(201,168,76,0.4);
  transform: translateY(-1px);
}

.kanban-card-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.kanban-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #34d399; }
.alert-error   { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.3);  color: #f87171; }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); color: #fbbf24; }

/* ─── Empty State ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state i { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 1rem; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p  { font-size: 0.85rem; }

/* ─── Stats Row ───────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
}

.stat-box .stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-box .stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* ─── Login Page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg-primary);
  background-image: radial-gradient(
    ellipse at 20% 50%,
    rgba(201, 168, 76, 0.04) 0%,
    transparent 60%
  );
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  display: block;
}

.login-logo .logo-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

/* ─── Misc ────────────────────────────────────────────────── */
.text-gold    { color: var(--gold); }
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--green); }
.text-danger  { color: var(--red); }
.text-warning { color: var(--yellow); }

.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }

.section-label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

/* ============================================================
   MELHORIAS DE COMPATIBILIDADE E ACESSIBILIDADE
   ============================================================ */

body {
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

img,
svg {
  max-width: 100%;
}

.card,
.kpi-card,
.kanban-card,
.modal,
tbody td {
  overflow-wrap: anywhere;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

.btn:focus-visible,
.nav-item:focus-visible,
.logout-btn:focus-visible,
.modal-close:focus-visible,
.form-control:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

select.form-control {
  color-scheme: dark;
}

select.form-control option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Corrige o preenchimento automático do navegador no tema escuro */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-secondary) inset;
  box-shadow: 0 0 0 1000px var(--bg-secondary) inset;
  caret-color: var(--text-primary);
  transition: background-color 9999s ease-in-out 0s;
}

/* Menu mobile opcional */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.mobile-menu-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
  z-index: 90;
}

.mobile-overlay.open {
  display: block;
}

/* ============================================================
   RESPONSIVIDADE — TABLET E CELULAR
   ============================================================ */

@media (max-width: 1024px) {
  .page-container {
    padding: 28px 24px;
  }

  .form-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: min(280px, 86vw);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .page-container {
    padding: 20px 16px;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .page-title {
    font-size: 1.75rem;
  }

  .table-wrapper {
    border-radius: var(--radius);
  }

  thead th,
  tbody td {
    padding: 11px 12px;
  }
}

@media (max-width: 600px) {
  .modal-overlay {
    padding: 12px;
    align-items: flex-end;
  }

  .modal {
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 14px 14px 0 0;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .modal-footer {
    flex-direction: column-reverse;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .filters-bar {
    align-items: stretch;
  }

  .filters-bar .form-control,
  .filters-bar .btn,
  .search-input {
    width: 100%;
  }

  .search-input {
    min-width: 100%;
  }

  .card-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 28px 20px;
  }

  .login-logo {
    margin-bottom: 24px;
  }

  .login-logo .logo-text {
    font-size: 1.7rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header .btn {
    width: 100%;
    justify-content: center;
  }

  .page-title {
    font-size: 1.55rem;
  }

  .card,
  .kpi-card {
    padding: 16px;
  }

  .kanban-col {
    width: 82vw;
    max-width: 280px;
  }
}

@media (max-width: 360px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 24px 16px;
  }

  .page-container {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* Reduz movimentos para usuários que ativaram essa preferência */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   CAMPOS COM MÁSCARA, CEP E CNPJ
   ============================================================ */

.form-control.field-invalid,
input.field-invalid,
select.field-invalid,
textarea.field-invalid {
    border-color: #ef4444 !important;
    box-shadow:
        0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

.form-control.field-valid,
input.field-valid,
select.field-valid,
textarea.field-valid {
    border-color: #22c55e !important;
    box-shadow:
        0 0 0 3px rgba(34, 197, 94, 0.1) !important;
}

.form-control.field-loading,
input.field-loading {
    padding-right: 42px;
    background-image:
        linear-gradient(
            90deg,
            transparent,
            rgba(201, 168, 76, 0.08),
            transparent
        );
    background-size: 200% 100%;
    animation: vexFieldLoading 1.2s linear infinite;
}

.field-autofilled {
    animation: vexFieldAutofilled 1.8s ease;
}

.field-message {
    display: block;
    margin-top: 6px;
    font-size: 0.72rem;
    line-height: 1.4;
}

.field-message-error {
    color: #ef4444;
}

.field-message-success {
    color: #22c55e;
}

.field-message-loading {
    color: var(--gold, #c9a84c);
}

.vex-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    max-width: min(390px, calc(100% - 32px));
    padding: 14px 18px;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: #111827;
    color: #ffffff;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
    font-size: 0.82rem;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease,
        transform 0.3s ease;
}

.vex-toast.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.vex-toast-success {
    border-left: 4px solid #22c55e;
}

.vex-toast-error {
    border-left: 4px solid #ef4444;
}

@keyframes vexFieldLoading {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

@keyframes vexFieldAutofilled {
    0% {
        background-color: rgba(201, 168, 76, 0.22);
    }

    100% {
        background-color: transparent;
    }
}

@media (max-width: 640px) {
    .vex-toast {
        right: 16px;
        bottom: 16px;
        left: 16px;
        max-width: none;
    }
}
/* ============================================================
   CAMPOS COM MÁSCARA, CEP E CNPJ
   ============================================================ */

.form-control.field-invalid,
input.field-invalid,
select.field-invalid,
textarea.field-invalid {
    border-color: #ef4444 !important;
    box-shadow:
        0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

.form-control.field-valid,
input.field-valid,
select.field-valid,
textarea.field-valid {
    border-color: #22c55e !important;
    box-shadow:
        0 0 0 3px rgba(34, 197, 94, 0.1) !important;
}

.form-control.field-loading,
input.field-loading {
    padding-right: 42px;
    background-image:
        linear-gradient(
            90deg,
            transparent,
            rgba(201, 168, 76, 0.08),
            transparent
        );
    background-size: 200% 100%;
    animation: vexFieldLoading 1.2s linear infinite;
}

.field-autofilled {
    animation: vexFieldAutofilled 1.8s ease;
}

.field-message {
    display: block;
    margin-top: 6px;
    font-size: 0.72rem;
    line-height: 1.4;
}

.field-message-error {
    color: #ef4444;
}

.field-message-success {
    color: #22c55e;
}

.field-message-loading {
    color: var(--gold, #c9a84c);
}

.vex-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    max-width: min(390px, calc(100% - 32px));
    padding: 14px 18px;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: #111827;
    color: #ffffff;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
    font-size: 0.82rem;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease,
        transform 0.3s ease;
}

.vex-toast.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.vex-toast-success {
    border-left: 4px solid #22c55e;
}

.vex-toast-error {
    border-left: 4px solid #ef4444;
}

@keyframes vexFieldLoading {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

@keyframes vexFieldAutofilled {
    0% {
        background-color: rgba(201, 168, 76, 0.22);
    }

    100% {
        background-color: transparent;
    }
}

@media (max-width: 640px) {
    .vex-toast {
        right: 16px;
        bottom: 16px;
        left: 16px;
        max-width: none;
    }
}