/* Estilos personalizados para el formulario de denuncia */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #2563eb; /* alineado con base/index.css y Tailwind */
    --primary-hover: #1e40af;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --light-bg: #f8fafc;
    --dark-bg: #0f172a;
    --border-color: #e5e7eb;
    --text-color: #111827;
    --white: #ffffff;
    --shadow: 0 8px 24px rgba(14, 15, 94, 0.15);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--light-bg);
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.6;
}

/* Usar sizing de index.css (container y content) para igualar plagas */

/* Encabezado anterior reemplazado por hero global; se conserva por compatibilidad si aún existe */
.form-header {
    background: transparent;
    color: inherit;
    padding: 0;
    text-align: center;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header-logo { flex-shrink: 0; }

.logo-image {
    height: 60px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.header-text { text-align: center; }

.header-text h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.form-content { padding: 0; }

.form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 2px;
}

.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea { min-height: 120px; resize: vertical; }

.radio-group,
.checkbox-group { display: flex; flex-direction: column; gap: 12px; }

.radio-item,
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-item:hover,
.checkbox-item:hover { border-color: var(--primary-color); background: rgba(37, 99, 235, 0.05); }

.radio-item.selected,
.checkbox-item.selected { border-color: var(--primary-color); background: rgba(37, 99, 235, 0.1); }

.radio-input,
.checkbox-input { width: 18px; height: 18px; accent-color: var(--primary-color); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 20px; }

.hidden { display: none !important; }

.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.file-upload-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.map-container {
    width: 100%;
    height: 320px; /* igual que plagas */
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-top: 8px;
}

/* Controles del mapa */
.map-controls { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

/* Texto de ayuda (coincide con plagas.css) */
.help-text { color: #64748b; font-size: 0.875rem; margin-top: 4px; }

.btn-map {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-map:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af); transform: translateY(-1px); box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4); }

.btn-map.btn-secondary { background: linear-gradient(135deg, #6b7280, #4b5563); }
.btn-map.btn-secondary:hover { background: linear-gradient(135deg, #4b5563, #374151); }

.coordinates-display { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 6px; padding: 8px 12px; margin-top: 10px; font-size: 0.85rem; color: #6c757d; display: none; }
.coordinates-display.show { display: block; }

.location-info { background: #e3f2fd; border: 1px solid #bbdefb; border-radius: 6px; padding: 12px; margin-bottom: 15px; font-size: 0.9rem; color: #1565c0; }
.location-info i { margin-right: 8px; color: #1976d2; }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

.btn-info { background: var(--primary-color); color: white; }
.btn-info:hover { background: var(--primary-hover); }

.mt-2 { margin-top: 8px; }

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-secondary { background: var(--secondary-color); color: white; }
.btn-secondary:hover { background: #475569; }

.btn-success { background: var(--success-color); color: white; }
.btn-success:hover { background: #047857; }

.form-actions { display: flex; justify-content: center; gap: 15px; margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--border-color); }

.alert { padding: 15px 20px; border-radius: 8px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; animation: slideInRight 0.3s ease-out; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); font-weight: 500; }

.alert-success { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); color: #065f46; }
.alert-error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #991b1b; }
.alert-info { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.3); color: #1e40af; }
.alert-warning { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); color: #92400e; }

/* Animaciones */
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }
.alert.fade-out { animation: slideOutRight 0.3s ease-in forwards; }

/* Contenedor de mensajes */
#message-container { position: fixed; top: 20px; right: 20px; z-index: 9999; max-width: 400px; width: auto; }
#message-container .alert { margin-bottom: 10px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

/* Sub-opciones */
.sub-options-group { display: flex; flex-direction: column; gap: 8px; margin-top: 15px; padding: 15px; background: #f8fafc; border-radius: 8px; border: 1px solid var(--border-color); }
.sub-option-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border: 1px solid #e2e8f0; border-radius: 6px; cursor: pointer; transition: all 0.3s ease; background: white; }
.sub-option-item:hover { border-color: var(--primary-color); background: rgba(37, 99, 235, 0.05); }
.sub-option-item.selected { border-color: var(--primary-color); background: rgba(37, 99, 235, 0.1); }
.sub-option-item label { flex: 1; font-size: 0.9rem; line-height: 1.4; color: var(--text-color); cursor: pointer; margin: 0; }
.sub-option-item .checkbox-input { margin-top: 2px; flex-shrink: 0; }

/* Responsive Design */
@media (max-width: 768px) {
    /* layout y espaciados los controla index.css; se evita doble padding */
    .header-text h1 { font-size: 1.5rem; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column; }
    .btn { width: 100%; justify-content: center; }
    body { background: var(--light-bg); }
}

@media (max-width: 480px) {
    .header-text h1 { font-size: 1.25rem; }
    .section-title { font-size: 1.1rem; }
}

/* Contador de caracteres */
.descripcion-counter-container { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.character-counter { font-size: 0.875rem; font-weight: 500; padding: 4px 8px; border-radius: 4px; transition: all 0.3s ease; min-width: 60px; text-align: center; }
.character-counter.insufficient { background-color: rgba(220, 38, 38, 0.1); color: #dc2626; border: 1px solid rgba(220, 38, 38, 0.3); }
.character-counter.sufficient { background-color: rgba(16, 185, 129, 0.1); color: #059669; border: 1px solid rgba(16, 185, 129, 0.3); }
.character-counter.neutral { background-color: rgba(107, 114, 128, 0.1); color: #6b7280; border: 1px solid rgba(107, 114, 128, 0.3); }

/* Archivos subidos */
.file-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%); border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 8px; transition: all 0.3s ease; position: relative; overflow: hidden; }
.file-item:hover { border-color: var(--primary-color); box-shadow: 0 2px 8px rgba(14, 15, 94, 0.1); transform: translateY(-1px); }
.file-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)); opacity: 0; transition: opacity 0.3s ease; }
.file-item:hover::before { opacity: 1; }
.file-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.file-name { font-weight: 600; color: var(--text-color); font-size: 0.9rem; margin-bottom: 4px; word-break: break-word; line-height: 1.3; }
.file-size { font-size: 0.8rem; color: #64748b; font-weight: 500; }
.file-icon { width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-right: 12px; font-size: 1.2rem; flex-shrink: 0; }
.file-icon.pdf { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.file-icon.image { background: linear-gradient(135deg, #10b981, #059669); color: white; }
.file-icon.video { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: white; }
.file-icon.document { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; }
.file-icon.default { background: linear-gradient(135deg, #6b7280, #4b5563); color: white; }
.remove-file { background: #fee2e2; border: 1px solid #fecaca; color: #dc2626; border-radius: 6px; padding: 8px; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; }
.remove-file:hover { background: #fecaca; border-color: #f87171; transform: scale(1.05); }
.remove-file i { font-size: 0.8rem; }

/* Animación para archivos recién agregados */
@keyframes fileSlideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
.file-item.new { animation: fileSlideIn 0.3s ease-out; }

/* Vacío */
.file-list-empty { text-align: center; padding: 20px; color: #64748b; font-style: italic; }

/* Responsive archivos */
@media (max-width: 480px) {
    .file-item { padding: 10px 12px; }
    .file-icon { width: 32px; height: 32px; margin-right: 8px; font-size: 1rem; }
    .file-name { font-size: 0.85rem; }
    .file-size { font-size: 0.75rem; }
    .remove-file { width: 28px; height: 28px; padding: 6px; }
}

/* Modal de confirmación */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; z-index: 9999; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal-content { background: white; border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); max-width: 500px; width: 90%; max-height: 90vh; overflow-y: auto; transform: scale(0.8) translateY(20px); transition: all 0.3s ease; position: relative; }
.modal-overlay.show .modal-content { transform: scale(1) translateY(0); }
.modal-header { background: linear-gradient(135deg, var(--success-color), #20c997); color: white; padding: 25px 30px; text-align: center; border-radius: 16px 16px 0 0; position: relative; overflow: hidden; }
.modal-header::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%); animation: shimmer 3s ease-in-out infinite; }
@keyframes shimmer { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(180deg); } }
.modal-success-icon { font-size: 3rem; margin-bottom: 15px; display: block; animation: bounceIn 0.6s ease-out; }
@keyframes bounceIn { 0% { transform: scale(0); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }
.modal-title { font-size: 1.5rem; font-weight: 700; margin: 0; position: relative; z-index: 1; }
.modal-subtitle { font-size: 1rem; opacity: 0.9; margin: 5px 0 0 0; position: relative; z-index: 1; }
.modal-body { padding: 30px; }
.denuncia-info { background: #f8f9fa; border-radius: 12px; padding: 20px; margin-bottom: 25px; border-left: 4px solid var(--success-color); }
.info-item { display: flex; align-items: center; margin-bottom: 12px; font-size: 0.95rem; }
.info-item:last-child { margin-bottom: 0; }
.info-icon { width: 20px; margin-right: 12px; color: var(--primary-color); font-weight: 600; }
.info-label { font-weight: 600; color: var(--text-color); margin-right: 8px; }
.info-value { color: #6c757d; flex: 1; }
.folio-highlight { background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)); color: white; padding: 15px 20px; border-radius: 10px; text-align: center; margin-bottom: 20px; font-weight: 600; font-size: 1.1rem; box-shadow: 0 4px 15px rgba(14, 15, 94, 0.3); }
.modal-question { text-align: center; margin-bottom: 25px; font-size: 1.1rem; font-weight: 500; color: var(--text-color); }
.modal-actions { display: flex; gap: 15px; justify-content: center; }
.modal-btn { padding: 12px 30px; border: none; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 140px; }
.modal-btn-primary { background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)); color: white; box-shadow: 0 4px 15px rgba(14, 15, 94, 0.3); }
.modal-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(14, 15, 94, 0.4); }
.modal-btn-secondary { background: #6c757d; color: white; box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3); }
.modal-btn-secondary:hover { background: #5a6268; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4); }
.modal-btn i { font-size: 1rem; }

/* Responsive para modal */
@media (max-width: 768px) {
    .modal-content { width: 95%; margin: 20px; }
    .modal-header { padding: 20px 25px; }
    .modal-body { padding: 25px 20px; }
    .modal-actions { flex-direction: column; }
    .modal-btn { width: 100%; }
    .modal-title { font-size: 1.3rem; }
    .modal-success-icon { font-size: 2.5rem; }
}

/* Alineación con index.css de plagas: usar tokens base y añadir estilos compartidos */
:root {
  --primary-color: var(--color-primary);
  --primary-hover: var(--color-primary-dark);
  --secondary-color: #64748b;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: var(--color-primary);
  --light-bg: var(--color-bg);
  --dark-bg: #0f172a;
  --border-color: var(--color-border);
  --text-color: var(--color-text);
  --white: #ffffff;
  --shadow: var(--shadow-sm);
}

/* Indicador de requerido, alineado con plagas */
.req {
  color: #dc2626;
  margin-left: 4px;
  font-weight: 600;
}

/* Texto de error uniforme */
.error-text {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 4px;
}

/* Fieldset accesible para grupos como el mapa */
fieldset.form-group {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
}
fieldset.form-group > legend {
  font-weight: 600;
  padding: 0 8px;
}

/* Radio grid compartido con plagas */
.radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: start;
}
.radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.radio-item:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary-color);
}
.radio-item input[type="radio"] {
  accent-color: var(--primary-color);
}

/* Inputs y selects respetando tokens base */
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: #fff;
  color: var(--text-color);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Controles del mapa en línea con plagas */
.map-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.map-container {
  width: 100%;
  height: 350px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}
.coordinates-display {
  margin-top: 8px;
  font-size: 0.9rem;
  color: #334155;
}

/* Botones alineados a index.css */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-color);
}
.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}
.btn-secondary {
  background-color: #e2e8f0;
  color: #0f172a;
}
.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}
.btn-success {
  background-color: var(--success-color);
  color: #fff;
  border-color: var(--success-color);
}

/* Ajustes de grupos y secciones */
.form-group {
  margin-bottom: 16px;
}
.section-title {
  margin-bottom: 12px;
}
.help-text {
  color: #64748b;
}

/* Upload área consistente */
.file-upload {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  background: #fff;
}
.file-upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .radio-grid { grid-template-columns: 1fr; }
  .map-container { height: 280px; }
}

/* ================= PRIVACY MODAL (overlay con fondo difuminado) ================= */
.privacy-modal-open {
  overflow: hidden; /* evitar scroll del body cuando el modal está abierto */
}

.privacy-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 24px;
}

.privacy-modal {
  background: #fff;
  color: #222;
  max-width: 720px;
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  padding: 24px;
  position: relative;
}

.privacy-modal h2 {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.privacy-modal p {
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.privacy-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Botón de cierre */
.privacy-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: #475569;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.privacy-modal-close:hover {
  background: #f1f5f9;
}
.privacy-modal-close:active {
  transform: scale(0.98);
}

/* Compatibilidad básica si backdrop-filter no está disponible: intensificar el oscurecimiento */
@supports not ((backdrop-filter: blur(4px))) {
  .privacy-modal-overlay {
    background: rgba(0, 0, 0, 0.55);
  }
}

/* Responsivo */
@media (max-width: 480px) {
  .privacy-modal {
    padding: 18px;
  }
  .privacy-modal h2 {
    font-size: 1.125rem;
  }
}
