/* =============================================
   AGM BRASIL - Components Extras
   ============================================= */

/* =============================================
   MAPA BRASIL
   ============================================= */
.map-container {
  position: relative;
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--agm-gray-200);
  overflow: hidden;
}
.map-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--agm-gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--agm-gray-100);
}
.map-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--agm-gray-600);
}
.map-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.map-svg-area {
  padding: 20px;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #e8f4fd 0%, #d1e8f5 100%);
}
.brazil-map svg { width: 100%; max-width: 600px; }
.map-state {
  cursor: pointer;
  transition: fill 0.2s, opacity 0.2s;
}
.map-state:hover { opacity: 0.8; }
.map-state.active { fill: var(--agm-blue) !important; }
.map-tooltip {
  position: absolute;
  background: var(--agm-gray-900);
  color: white;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  pointer-events: none;
  z-index: 100;
  min-width: 160px;
  box-shadow: var(--shadow-xl);
  display: none;
}
.map-tooltip.visible { display: block; }
.map-tooltip-title { font-weight: 700; margin-bottom: 6px; font-size: 13px; color: var(--agm-gold); }
.map-tooltip-row { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 3px; }
.map-tooltip-row span:first-child { color: rgba(255,255,255,0.7); }
.map-tooltip-row span:last-child { font-weight: 600; }

/* States color scale */
.map-scale-0 { fill: #e2e8f0; }
.map-scale-1 { fill: #bfdbfe; }
.map-scale-2 { fill: #93c5fd; }
.map-scale-3 { fill: #60a5fa; }
.map-scale-4 { fill: #3b82f6; }
.map-scale-5 { fill: #1d4ed8; }

/* =============================================
   UPLOAD DE ARQUIVO
   ============================================= */
.upload-zone {
  border: 2px dashed var(--agm-gray-300);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--agm-gray-50);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--agm-blue);
  background: var(--agm-info-light);
}
.upload-zone-icon { font-size: 48px; color: var(--agm-gray-300); margin-bottom: 12px; display: block; }
.upload-zone-title { font-size: 15px; font-weight: 600; color: var(--agm-gray-700); margin-bottom: 6px; }
.upload-zone-text { font-size: 13px; color: var(--agm-gray-400); }
.upload-zone input[type="file"] { display: none; }

.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: white;
  border: 1px solid var(--agm-gray-200);
  border-radius: var(--radius-md);
}
.file-icon { font-size: 22px; flex-shrink: 0; }
.file-icon.pdf { color: #ef4444; }
.file-icon.img { color: var(--agm-blue); }
.file-icon.video { color: #8b5cf6; }
.file-icon.audio { color: var(--agm-success); }
.file-info { flex: 1; }
.file-name { font-size: 13px; font-weight: 600; color: var(--agm-gray-800); }
.file-size { font-size: 11px; color: var(--agm-gray-400); }
.file-status { font-size: 12px; font-weight: 600; }
.file-remove { background: none; border: none; color: var(--agm-gray-400); cursor: pointer; font-size: 16px; padding: 4px; transition: var(--transition); }
.file-remove:hover { color: var(--agm-danger); }

/* =============================================
   STEPPER / WIZARD
   ============================================= */
.stepper { display: flex; align-items: center; margin-bottom: 36px; }
.stepper-item { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; }
.stepper-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  left: 50%;
  right: -50%;
  height: 2px;
  background: var(--agm-gray-200);
  z-index: 0;
}
.stepper-item.completed:not(:last-child)::after { background: var(--agm-blue); }
.stepper-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--agm-gray-200);
  color: var(--agm-gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  position: relative;
  z-index: 1;
  transition: var(--transition);
}
.stepper-item.active .stepper-num { background: var(--agm-blue); color: white; box-shadow: 0 0 0 4px rgba(37,99,235,0.2); }
.stepper-item.completed .stepper-num { background: var(--agm-success); color: white; }
.stepper-label { font-size: 12px; color: var(--agm-gray-500); margin-top: 6px; text-align: center; font-weight: 500; }
.stepper-item.active .stepper-label { color: var(--agm-blue); font-weight: 700; }
.stepper-item.completed .stepper-label { color: var(--agm-success); }

/* =============================================
   EDITOR JURÍDICO
   ============================================= */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 14px;
  background: var(--agm-gray-50);
  border: 1px solid var(--agm-gray-200);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.editor-btn {
  padding: 6px 10px;
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: var(--agm-gray-600);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}
.editor-btn:hover { background: white; border-color: var(--agm-gray-200); color: var(--agm-gray-800); }
.editor-btn.active { background: var(--agm-info-light); border-color: var(--agm-blue); color: var(--agm-blue); }
.editor-divider { width: 1px; background: var(--agm-gray-200); margin: 0 4px; }
.editor-body {
  min-height: 500px;
  border: 1px solid var(--agm-gray-200);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 40px;
  background: white;
  font-family: 'Georgia', serif;
  font-size: 14px;
  line-height: 1.8;
  color: var(--agm-gray-800);
  outline: none;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.03);
}
.editor-body:focus { border-color: var(--agm-blue); }
.editor-dynamic-field {
  display: inline-block;
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.4);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--agm-gold-dark);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

/* =============================================
   ASSINATURA
   ============================================= */
.signature-canvas-wrap {
  border: 2px dashed var(--agm-gray-300);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: crosshair;
  background: white;
  position: relative;
}
.signature-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 200px;
}
.signature-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--agm-gray-300);
  font-size: 14px;
  pointer-events: none;
}
.signature-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* Camera/Foto */
.camera-capture {
  border: 2px dashed var(--agm-gray-300);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  background: var(--agm-gray-50);
  cursor: pointer;
  transition: var(--transition);
}
.camera-capture:hover { border-color: var(--agm-blue); background: var(--agm-info-light); }
.camera-preview { width: 100%; border-radius: var(--radius-md); display: none; }

/* =============================================
   DOCUMENTO VIEWER
   ============================================= */
.doc-viewer {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--agm-gray-200);
  overflow: hidden;
}
.doc-viewer-header {
  padding: 16px 24px;
  background: var(--agm-gray-50);
  border-bottom: 1px solid var(--agm-gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.doc-viewer-title { font-size: 14px; font-weight: 700; color: var(--agm-gray-800); }
.doc-viewer-tools { display: flex; gap: 8px; }
.doc-viewer-body { padding: 40px; min-height: 600px; }
.doc-content {
  max-width: 700px;
  margin: 0 auto;
  font-family: 'Georgia', serif;
  font-size: 14px;
  line-height: 1.9;
  color: var(--agm-gray-800);
}
.doc-header-text { text-align: center; margin-bottom: 40px; }
.doc-header-text h2 { font-size: 16px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.doc-section { margin-bottom: 24px; }
.doc-section h3 { font-size: 14px; text-transform: uppercase; margin-bottom: 8px; font-weight: 700; }
.doc-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 60px;
  padding-top: 20px;
}
.doc-signature-line { border-top: 1px solid var(--agm-gray-800); padding-top: 8px; font-size: 12px; text-align: center; }

/* =============================================
   FLUXO CONVERSACIONAL
   ============================================= */
.conv-flow {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 20px;
}
.conv-flow-header { text-align: center; margin-bottom: 48px; }
.conv-flow-logo { margin-bottom: 24px; }
.conv-flow-logo img { height: 60px; }
.conv-question {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--agm-gray-800);
  margin-bottom: 32px;
  line-height: 1.4;
  animation: slideInUp 0.4s ease;
}
.conv-input-group { animation: slideInUp 0.4s ease 0.1s both; }
.conv-input { font-size: 1.1rem; padding: 16px 20px; }
.conv-btn { padding: 16px 36px; font-size: 1rem; width: 100%; margin-top: 14px; }
.conv-choices { display: flex; flex-direction: column; gap: 12px; }
.conv-choice {
  padding: 16px 20px;
  border: 2px solid var(--agm-gray-200);
  border-radius: var(--radius-lg);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  background: white;
  display: flex;
  align-items: center;
  gap: 12px;
}
.conv-choice:hover { border-color: var(--agm-blue); background: var(--agm-info-light); color: var(--agm-blue); }
.conv-choice.selected { border-color: var(--agm-blue); background: var(--agm-info-light); color: var(--agm-blue); }
.conv-progress { height: 4px; background: var(--agm-gray-100); border-radius: var(--radius-full); margin-bottom: 40px; }
.conv-progress-bar { height: 100%; background: linear-gradient(90deg, var(--agm-blue), var(--agm-gold)); border-radius: var(--radius-full); transition: width 0.5s ease; }
.conv-back { color: var(--agm-gray-400); font-size: 13px; cursor: pointer; background: none; border: none; display: flex; align-items: center; gap: 4px; margin-bottom: 24px; transition: var(--transition); }
.conv-back:hover { color: var(--agm-gray-700); }

/* =============================================
   PAGINAÇÃO
   ============================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--agm-gray-100);
  flex-wrap: wrap;
  gap: 12px;
}
.pagination-info { font-size: 13px; color: var(--agm-gray-500); }
.pagination-pages { display: flex; gap: 4px; }
.page-btn {
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--agm-gray-200);
  background: white;
  color: var(--agm-gray-600);
  transition: var(--transition);
}
.page-btn:hover { background: var(--agm-gray-100); border-color: var(--agm-gray-300); }
.page-btn.active { background: var(--agm-blue); border-color: var(--agm-blue); color: white; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* =============================================
   PRINT
   ============================================= */
@media print {
  .sidebar, .panel-topbar, .page-actions, .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
  body { background: white !important; }
}
