/* =====================================================
   ESTILOS HOJA DE VIDA PERSONA JURÍDICA
   Exactamente alineados con Formato Único Persona Natural
   ===================================================== */
* {
  box-sizing: border-box;
}

:root {
  --brand: #0b91a6;
  --brand-600: #087a8c;
  --brand-dark: #06233a;
  --ink: #1e293b;
  --muted: #64748b;
  --surface: #ffffff;
  --line: #e2e8f0;
  --shell: 1650px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(6, 35, 58, 0.08);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  --radius: 8px;
  --radius-lg: 12px;
}

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 50%, #e8eefb 100%);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  color: var(--ink);
  line-height: 1.5;
}

h1 {
  margin: 30px auto 20px;
  color: #06233a;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
  text-align: center;
}

/* =====================================================
   LAYOUT PRINCIPAL (PROPORCIÓN EXACTA 0.8fr / 1.2fr)
   ===================================================== */
.form-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
  padding: 0 16px 40px;
}

@media (min-width: 901px) {
  .container {
    max-width: 1650px !important;
    width: 96% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .form-container {
    max-width: 1600px !important;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr) !important;
    gap: 22px !important;
  }

  form#form, form#formulario {
    min-width: 0 !important;
    width: 100% !important;
    display: flex;
    flex-direction: column;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }

  #previewDesktopContainer {
    min-width: 0 !important;
    width: 100% !important;
  }

  .form-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap !important;
    gap: 10px;
    margin: 16px auto 18px auto !important;
    padding: 0 !important;
    width: 100%;
    position: static !important;
    background: transparent !important;
    box-shadow: none !important;
  }
}

@media (min-width: 1201px) {
  .form-container {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) !important;
    gap: 28px !important;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .form-actions {
    gap: 8px !important;
  }

  .btn-preview-top,
  #btn-preview,
  .btn-manage-pdf,
  .btn-clear-form,
  .btn-dev-fill,
  #btn-pay-download {
    padding: 8px 13px !important;
    font-size: 13px !important;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
  }

  .canvas-wrapper {
    padding: 10px !important;
  }
}

form#form, form#formulario {
  background: linear-gradient(to bottom, #fff, #f8fafc);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.6);
}

.panel-placeholder {
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.03), rgba(118, 75, 162, 0.03));
  border: 1px dashed rgba(102, 126, 234, 0.25);
  border-radius: 12px;
  font-size: 14px;
  color: #4a5568;
}

/* =====================================================
   ENCABEZADOS DE GRUPOS COLAPSABLES (.COLLAPSIBLE-H2)
   Exactamente alineados con /formato-unico-hoja-de-vida/
   ===================================================== */
.panel-placeholder h2,
.collapsible-h2 {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  font-size: 22px;
  font-weight: 700;
  color: #06233a;
  margin: 0 0 12px 0;
  line-height: 1.3;
  text-transform: uppercase;
  transition: color 0.15s ease;
}

.panel-placeholder h2:first-child,
.panel-placeholder h2:first-of-type,
.collapsible-h2:first-child,
.collapsible-h2:first-of-type {
  margin-top: 4px;
}

.collapsible-h2:not(:first-child) {
  margin-top: 26px;
}

.collapsible-h2:hover {
  color: #0b91a6;
}

.collapsible-h2::after {
  content: '▾';
  margin-left: auto;
  font-size: 22px;
  line-height: 1;
  transition: transform .2s ease;
  color: #06233a;
}

.collapsible-h2[aria-expanded="false"]::after {
  transform: rotate(-90deg);
}

.section-collapse {
  margin-bottom: 12px;
}

.section-collapse[hidden] {
  display: none;
}

@media (min-width: 700px) {
  .panel-placeholder h2,
  .collapsible-h2 {
    font-size: 28px;
  }
}

@media (min-width: 1000px) {
  .panel-placeholder h2,
  .collapsible-h2 {
    font-size: 34px;
  }
}

h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: #06233a;
  margin: 10px 0 4px;
  text-transform: uppercase;
}

.btn-clear-form {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  padding: 9px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: block;
  margin: 12px auto 0 auto !important;
  text-align: center;
}

.btn-clear-form:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #1e293b;
  transform: translateY(-1px);
}

/* =====================================================
   ACORDEONES DE CAMPOS (DETAILS.SECTION / SUMMARY)
   ===================================================== */
details.section {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

details.section:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

details.section[open] {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(6, 35, 58, 0.06);
}

details.section summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  padding: 12px 16px;
  font-size: 15px;
  color: #1e293b;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  transition: background-color 0.15s ease, color 0.15s ease;
}

details.section summary::-webkit-details-marker {
  display: none;
}

details.section summary:hover {
  background-color: #f8fafc;
  color: #0b91a6;
}

details.section summary:after {
  content: '▼';
  font-size: 11px;
  color: #64748b;
  margin-left: auto;
  transition: transform 0.25s ease, color 0.2s ease;
}

details.section[open] summary {
  border-bottom: 1px solid #f1f5f9;
  background-color: #f8fafc;
  color: #0b91a6;
}

details.section[open] summary:after {
  transform: rotate(180deg);
  color: #0b91a6;
}

details.section .form-grid {
  padding: 16px;
}

@media (max-width: 900px) {
  details.section summary {
    font-size: 14px;
    padding: 10px 12px;
  }

  details.section .form-grid {
    padding: 12px;
  }
}

/* =====================================================
   GRILLA DE CAMPOS (FORM-GRID)
   ===================================================== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  align-items: start;
}

.form-grid .full {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
}

/* =====================================================
   AJUSTADORES DE TAMAÑO DE FUENTE (A- / A+) EN INPUTS
   ===================================================== */
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
  margin-bottom: 3px;
  width: 100%;
}

.field-label-row label {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  display: inline-block !important;
}

.form-font-adjuster {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px 4px;
  user-select: none;
}

.form-font-adjuster-btn {
  background: #0b91a6 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 4px !important;
  padding: 1px 6px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  cursor: pointer !important;
  box-shadow: none !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
}

.form-font-adjuster-btn.btn-minus {
  background: #64748b !important;
}

.form-font-adjuster-btn:hover {
  opacity: 0.88;
  transform: scale(1.05);
}

.form-font-adjuster-btn:active {
  transform: scale(0.95);
}

.form-font-adjuster-val {
  font-size: 11px;
  color: #0f172a;
  font-weight: 700;
  min-width: 26px;
  text-align: center;
  user-select: none;
}

label {
  display: block;
  margin-top: 4px;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 12.5px;
  color: #334155;
  letter-spacing: 0.1px;
}

input,
select,
textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 7px;
  box-sizing: border-box;
  font-size: 13.5px;
  line-height: 1.4;
  font-family: inherit;
  color: #0f172a;
  background-color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input:not([type]),
select,
textarea {
  text-transform: uppercase;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #0b91a6;
  box-shadow: 0 0 0 3px rgba(11, 145, 166, 0.15);
}

input[type="file"] {
  padding: 6px;
  font-size: 12px;
  background: #f8fafc;
}

/* Dynamic counter & buttons */
.service-actions,
.exp-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

#add-service-btn,
.btn-add-item {
  background: #f1f5f9;
  color: #0b91a6;
  border: 1px dashed #0b91a6;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

#add-service-btn:hover,
.btn-add-item:hover {
  background: #e0f2fe;
  border-style: solid;
}

/* =====================================================
   BOTONES DE ACCIÓN (PAGAR / VISTA PREVIA)
   ===================================================== */
@media (min-width: 901px) {
  .form-actions,
  .fixed-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
  }
}

.btn-preview-top,
#btn-preview {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(37, 99, 235, 0.4) !important;
  border-radius: 8px !important;
  padding: 10px 22px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.btn-preview-top:hover,
#btn-preview:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.38) !important;
  transform: translateY(-1px);
}

/* Herramientas de desarrollo (ocultas en producción por defecto) */
.dev-only-tool {
  display: none;
}

body.is-dev-mode .dev-only-tool {
  display: inline-flex;
}

.btn-dev-fill,
#devFillBtn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-dev-fill:hover,
#devFillBtn:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.38);
  transform: translateY(-1px);
}

.btn-dev-blob,
#devBlobPreviewBtn {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border: 1px solid rgba(5, 150, 105, 0.4);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-dev-blob:hover,
#devBlobPreviewBtn:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.38);
  transform: translateY(-1px);
}

#btn-pay-download {
  background: linear-gradient(135deg, #0b91a6 0%, #087a8c 100%);
  color: #ffffff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(11, 145, 166, 0.35);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#btn-pay-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(11, 145, 166, 0.45);
}

.btn-generate-pdf-hidden {
  display: none !important;
}

@media (max-width: 900px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
  }

  .container {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 0 !important;
    margin: 0 auto !important;
    overflow-x: hidden !important;
  }

  .form-actions,
  .fixed-actions {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    padding: 10px 16px !important;
    border-top: 1px solid #cbd5e1 !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12) !important;
    z-index: 9999 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
    box-sizing: border-box !important;
  }

  .btn-clear-form {
    order: 1 !important;
    padding: 9px 14px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #btn-preview,
  .btn-preview-top {
    order: 2 !important;
    display: inline-flex !important;
    padding: 9px 16px !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #btn-manage-pdf,
  .btn-manage-pdf {
    order: 2 !important;
    display: inline-flex !important;
    padding: 9px 14px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #wompiPayBtn,
  #btn-pay-download,
  .btn-wompi-pay {
    order: 3 !important;
    padding: 9px 18px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    align-items: center !important;
    justify-content: center !important;
  }

  form#form, form#formulario {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  .form-container {
    grid-template-columns: 1fr !important;
    padding: 0 10px 90px 10px !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  #previewDesktopContainer {
    display: none !important;
  }
}

/* Pantallas móviles estrechas (<= 520px): Cada botón pasa a su propia fila completa */
@media (max-width: 520px) {
  .form-actions,
  .fixed-actions {
    flex-direction: column !important;
    padding: 10px 14px !important;
    gap: 8px !important;
  }

  .btn-clear-form {
    width: 100% !important;
    min-height: 38px !important;
    font-size: 13px !important;
  }

  #btn-preview,
  .btn-preview-top {
    width: 100% !important;
    min-height: 42px !important;
    font-size: 14px !important;
  }

  #btn-manage-pdf,
  .btn-manage-pdf {
    width: 100% !important;
    min-height: 40px !important;
    font-size: 13.5px !important;
  }

  #wompiPayBtn,
  #btn-pay-download,
  .btn-wompi-pay {
    width: 100% !important;
    min-height: 44px !important;
    font-size: 14.5px !important;
  }

  .form-container {
    padding-bottom: 175px !important;
  }
}

/* =====================================================
   VISIBILIDAD DEL BOTÓN DE PAGO (SOLO EN PESTAÑA 2)
   ===================================================== */
#wompiPayBtn,
#btn-pay-download,
.btn-wompi-pay {
  display: none !important;
}

body.is-page-2 #wompiPayBtn,
body.is-page-2 #btn-pay-download,
body.is-page-2 .btn-wompi-pay {
  display: inline-flex !important;
}

@media (max-width: 520px) {
  body.is-page-2 #wompiPayBtn,
  body.is-page-2 #btn-pay-download,
  body.is-page-2 .btn-wompi-pay {
    display: flex !important;
  }
}

/* =====================================================
   VISTA PREVIA DESKTOP (CANVAS ZOOM WRAPPER)
   ===================================================== */
.canvas-wrapper {
  position: sticky;
  top: 80px;
  background: white;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.8);
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.canvas-zoom-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.pdf-preview-canvas {
  width: 100%;
  height: auto;
  display: block;
}

.canvas-hidden {
  display: none !important;
}

.canvas-overlay {
  display: none;
}

/* =====================================================
   SECCIÓN SEO, INSTRUCCIONES Y RECOMENDACIONES
   ===================================================== */
.pdf-seo-wrapper {
  max-width: 1200px;
  margin: 20px auto 40px;
  padding: 0 16px;
}

@media (min-width: 901px) {
  .pdf-seo-wrapper {
    max-width: 1600px;
  }
}

.tool-instructions {
  background: #ffffff;
  padding: 28px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
}

.tool-instructions h3 {
  color: #06233a;
  font-size: 20px;
  margin-top: 0;
  margin-bottom: 16px;
}

.tool-instructions ol {
  padding-left: 20px;
  line-height: 1.7;
  color: #334155;
  font-size: 14.5px;
}

.wompi-notice {
  display: flex;
  gap: 14px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.wompi-notice-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.wompi-notice-title {
  margin: 0 0 4px 0;
  font-weight: 700;
  color: #166534;
  font-size: 14px;
}

.wompi-notice-btn {
  background: #16a34a;
  color: white !important;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  display: inline-block;
  margin-left: 6px;
}

.wompi-notice-desc {
  margin: 0;
  font-size: 12.5px;
  color: #15803d;
}

.seo-content {
  background: #ffffff;
  padding: 32px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  color: #334155;
  line-height: 1.7;
}

.seo-content h2 {
  color: #06233a;
  font-size: 22px;
  margin-top: 0;
}

.seo-content h3 {
  color: #06233a;
  font-size: 18px;
  margin-top: 24px;
}

.seo-content h4 {
  color: #0b91a6;
  font-size: 14.5px;
  margin-top: 16px;
  margin-bottom: 6px;
}

.seo-content ul {
  padding-left: 20px;
}

.tool-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.tool-link-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  display: block;
}

.tool-link-card:hover {
  border-color: #0b91a6;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(11, 145, 166, 0.12);
  transform: translateY(-2px);
}

.tool-link-card h4 {
  margin: 0 0 6px 0;
  color: #06233a;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-link-card p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
}

/* =====================================================
   BOTÓN MODO DESARROLLO (AUTO-LLENAR)
   ===================================================== */
.btn-dev-fill {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  border-radius: 8px !important;
  padding: 10px 18px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  align-items: center;
  gap: 6px;
}

.btn-dev-fill:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.38) !important;
  transform: translateY(-1px);
}

/* =====================================================
   GRUPO DE FIRMA Y BOTÓN QUITAR FIRMA
   ===================================================== */
.firma-input-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.firma-input-group input[type="file"] {
  flex: 1;
  min-width: 220px;
}

.btn-remove-firma {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1.5px solid #fca5a5 !important;
  border-radius: 8px !important;
  padding: 8px 14px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  white-space: nowrap !important;
  box-shadow: 0 1px 3px rgba(185, 28, 28, 0.1) !important;
}

.btn-remove-firma:hover {
  background: #fecaca !important;
  color: #991b1b !important;
  border-color: #f87171 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(185, 28, 28, 0.2) !important;
}

/* ============================================================ */
/* MODAL DE VISTA PREVIA (Mismo sistema que Persona Natural)    */
/* ============================================================ */
.preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.preview-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.preview-modal-container {
  position: relative;
  width: 90%;
  max-width: 900px;
  height: 90%;
  background: #e6eef2;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: zoomInModal 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes zoomInModal {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.preview-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.preview-modal-header h2 {
  font-size: 18px;
  color: #06233a;
  margin: 0;
  font-weight: 600;
  text-align: left;
}

.preview-modal-tabs {
  display: flex;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.preview-tab {
  flex: 1;
  border: none;
  background: none;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}

.preview-tab:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.preview-tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
  background: #fff;
}

.preview-close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  color: #718096;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.preview-close-btn:hover {
  background: #f4f8fa;
  color: #1a202c;
}

.preview-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: #cbd5e0;
}

.preview-modal-body canvas {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin: 0 auto;
  border: 1px solid #ddd;
  max-width: 100%;
  display: block;
}

.preview-modal.hidden {
  display: none !important;
}

body.lock-scroll {
  overflow: hidden !important;
}

/* ============================================================ */
/* BOTÓN Y GESTOR DE ADJUNTAR PDFS                             */
/* ============================================================ */
.btn-manage-pdf {
  background: #5d7285 !important;
  color: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  border-radius: 8px !important;
  padding: 10px 20px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(93, 114, 133, 0.25) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-manage-pdf:hover {
  background: #475569 !important;
  box-shadow: 0 4px 12px rgba(71, 85, 105, 0.35) !important;
  transform: translateY(-1px);
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  backdrop-filter: blur(2px);
}

.loading-overlay.hidden,
.hidden {
  display: none !important;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f1f5f9;
  border-top-color: #0b91a6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay p {
  font-weight: 600;
  color: #06233a;
}

/* Gestor de PDFs Adjuntos */
.manage-pdf-body {
  background-color: #fcfdfe !important;
}

.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, 160px);
  justify-content: center;
  gap: 16px;
  padding: 0;
  margin: 20px 0;
  list-style: none;
}

.file-item {
  width: 160px;
  max-width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 10px;
  background-color: #fff;
  border: 1px solid #e6eef2;
  border-radius: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  cursor: grab;
  box-sizing: border-box;
}

.file-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: #cfdee6;
  transform: translateY(-2px);
}

.file-thumbnail {
  width: 100px;
  height: 140px;
  background-color: #f4f8fa;
  border: 1px solid #cfdee6;
  border-radius: 4px;
  margin-bottom: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.file-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #fff;
  display: block;
}

.file-thumbnail.skeleton {
  animation: pulse-bg 1.5s infinite;
}

@keyframes pulse-bg {
  0% { background-color: #f4f8fa; }
  50% { background-color: #e6eef2; }
  100% { background-color: #f4f8fa; }
}

.file-info {
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin-bottom: 0;
}

.file-name {
  font-weight: 600;
  color: #06233a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  font-size: 13px;
  width: 100%;
}

.file-size {
  font-size: 11.5px;
  color: #8da4b3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.file-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e6eef2;
  box-sizing: border-box;
}

.control-btn {
  background: transparent !important;
  border: 1px solid #e6eef2 !important;
  border-radius: 6px;
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  color: #5d7285 !important;
  transition: all 0.2s;
  padding: 0;
  margin: 0 !important;
  box-shadow: none !important;
  flex-shrink: 0;
}

.control-btn:hover:not(:disabled) {
  background: #f4f8fa !important;
  color: #06233a !important;
  border-color: #cfdee6 !important;
}

.control-btn:disabled {
  opacity: 0.25 !important;
  cursor: not-allowed;
  background: #fafcfd !important;
}

.control-btn.remove-btn {
  color: #e25c5c !important;
  border-color: transparent !important;
}

.control-btn.remove-btn:hover {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border-color: transparent !important;
}

.control-btn svg {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  stroke: currentColor !important;
  fill: none !important;
}

/* Versión móvil compacta */
@media screen and (max-width: 768px) {
  .manage-pdf-body .file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding: 0;
    margin: 12px 0;
  }

  .manage-pdf-body .file-item {
    width: 100%;
    max-width: 100%;
    flex-direction: row;
    flex-wrap: nowrap;
    padding: 8px 10px;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-radius: 8px;
  }

  .manage-pdf-body .file-thumbnail {
    width: 42px;
    height: 56px;
    margin-bottom: 0;
    margin-right: 0;
    flex-shrink: 0;
    border-radius: 3px;
  }

  .manage-pdf-body .file-info {
    flex: 1;
    align-items: flex-start;
    text-align: left;
  }

  .manage-pdf-body .file-controls {
    width: auto;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    flex-shrink: 0;
  }
}

/* =====================================================
   TABS DE NAVEGACIÓN SUPERIOR DEL FORMULARIO (PÁGINAS)
   ===================================================== */
nav.tabs {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.tablist {
  display: flex;
  width: 100%;
  gap: 0;
}

.tab {
  flex: 1;
  text-align: center;
  background: #eef2f7;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 11px 16px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 600;
  position: relative;
  transition: all 0.2s ease;
  margin: 0;
}

.tab:hover {
  background: #e2e8f0;
}

.tab.active {
  background: #667eea;
  color: #ffffff;
  border-color: #667eea;
  box-shadow: 0 -2px 6px rgba(102, 126, 234, 0.25);
}

@media (min-width: 901px) {
  /* Acciones del Formulario alineadas en fila limpia (Imagen 2) */
  .form-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 16px auto 18px auto !important;
    padding: 0 !important;
    width: 100%;
    flex-wrap: wrap;
  }

  .form-actions button {
    margin: 0 !important;
  }
}

.btn-dev-fill {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  border-radius: 8px !important;
  padding: 10px 18px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}

.btn-dev-fill:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.38) !important;
  transform: translateY(-1px);
}

.btn-dev-blob {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(5, 150, 105, 0.4) !important;
  border-radius: 8px !important;
  padding: 10px 18px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}

.btn-dev-blob:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%) !important;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.38) !important;
  transform: translateY(-1px);
}

.btn-preview-top {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(37, 99, 235, 0.4) !important;
  border-radius: 8px !important;
  padding: 10px 22px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-preview-top:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.38) !important;
  transform: translateY(-1px);
}

.btn-manage-pdf {
  background: #5d7285 !important;
  color: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  border-radius: 8px !important;
  padding: 10px 20px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(93, 114, 133, 0.25) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-manage-pdf:hover {
  background: #475569 !important;
  box-shadow: 0 4px 12px rgba(71, 85, 105, 0.35) !important;
  transform: translateY(-1px);
}

#wompiPayBtn,
.btn-wompi-pay {
  background: #00b2a9 !important;
  background-color: #00b2a9 !important;
  color: #ffffff !important;
  border: 1px solid rgba(0, 178, 169, 0.4) !important;
  border-radius: 8px !important;
  padding: 10px 22px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(0, 178, 169, 0.25) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#wompiPayBtn:hover,
.btn-wompi-pay:hover {
  background: #00968f !important;
  background-color: #00968f !important;
  box-shadow: 0 4px 14px rgba(0, 178, 169, 0.38) !important;
  transform: translateY(-1px);
}


/* =====================================================
   TARJETAS DE TABLAS DE DATOS (PARIENTES, CUENTAS, BIENES)
   ===================================================== */
.table-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  transition: all 0.15s ease;
}

.table-card:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}

.table-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.table-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #0b91a6;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.btn-remove-card {
  background: #ffffff;
  color: #ef4444;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-remove-card:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #f87171;
  transform: scale(1.02);
}

.table-card .form-grid {
  padding: 0 !important;
  gap: 8px;
}

.currency-input {
  font-family: monospace, inherit;
  font-weight: 600;
}

/* =====================================================
   SECCIÓN DE FIRMA ESTÁNDAR (REGLA 5 AGENTS.MD)
   ===================================================== */
.signature-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-top: 6px;
}

.signature-image-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 4px;
  min-height: 52px;
  width: 100%;
  max-width: 320px;
}

.signature-img-placeholder {
  width: 100%;
  height: 52px;
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  gap: 6px;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  background: #ffffff;
  user-select: none;
}

.signature-img-placeholder:hover {
  border-color: #0b91a6;
  color: #0b91a6;
  background: rgba(11, 145, 166, 0.05);
}

.signature-preview-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 320px;
}

.signature-img-preview {
  max-height: 70px;
  max-width: 280px;
  object-fit: contain;
  display: block;
  cursor: pointer;
}

.btn-remove-signature {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-remove-signature:hover {
  background: #fca5a5;
  color: #991b1b;
}

.signature-line {
  width: 100%;
  max-width: 320px;
  border: none;
  border-top: 1.5px solid #111827;
  margin: 6px 0 2px;
}

.signature-name {
  margin: 0;
  font-weight: 700;
  font-size: 12px;
  color: #111827;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* =====================================================
   ARTÍCULO SEO Y GUÍA EXHAUSTIVA DE BIENES Y RENTAS
   ===================================================== */
.seo-content {
  max-width: 1060px;
  margin: 40px auto 60px;
  padding: 32px 36px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  color: #334155;
  font-size: 15.5px;
  line-height: 1.75;
}

.seo-content h2 {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin-top: 36px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f1f5f9;
  letter-spacing: -0.02em;
}

.seo-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin-top: 24px;
  margin-bottom: 12px;
}

.seo-content p {
  margin-bottom: 16px;
}

.seo-content ul,
.seo-content ol {
  margin-bottom: 18px;
  padding-left: 24px;
}

.seo-content li {
  margin-bottom: 8px;
}

.seo-content a {
  color: #0284c7;
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.15s;
}

.seo-content a:hover {
  color: #0369a1;
}

/* Callouts / Avisos */
.seo-callout {
  padding: 18px 20px;
  border-radius: 10px;
  margin: 22px 0;
  font-size: 14.5px;
  line-height: 1.6;
}

.seo-callout-info {
  background: #f0fdf4;
  border-left: 4px solid #16a34a;
  color: #166534;
}

.seo-callout-warning {
  background: #fffbeb;
  border-left: 4px solid #d97706;
  color: #92400e;
}

/* Grids y Tarjetas Informativas */
.seo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin: 22px 0;
}

.seo-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.seo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.seo-card h3 {
  margin-top: 0;
  color: #0b91a6;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.seo-card ul {
  padding-left: 18px;
  margin-bottom: 0;
}

/* Tablas comparativas */
.seo-table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.seo-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14.5px;
}

.seo-table th {
  background: #f1f5f9;
  color: #0f172a;
  padding: 12px 16px;
  font-weight: 700;
  border-bottom: 2px solid #cbd5e1;
}

.seo-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}

.seo-table tr:last-child td {
  border-bottom: none;
}

.seo-table tr:nth-child(even) td {
  background: #f8fafc;
}

/* Timeline / Momentos de presentación */
.seo-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 22px 0;
}

.seo-timeline-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #0b91a6;
  border-radius: 8px;
  padding: 16px 20px;
}

.seo-timeline-item h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #0f172a;
  font-weight: 700;
}

.seo-timeline-item p {
  margin-bottom: 0;
  font-size: 14px;
}

/* Acordeón FAQ */
.faq-accordion {
  margin: 24px 0;
}

.faq-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.faq-item[open] {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.faq-item summary {
  padding: 16px 20px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  list-style: none;
  position: relative;
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "＋";
  position: absolute;
  right: 20px;
  font-size: 18px;
  color: #0b91a6;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  content: "－";
}

.faq-item p {
  padding: 0 20px 18px 20px;
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: #475569;
}

@media (max-width: 768px) {
  .seo-content {
    padding: 20px 16px;
    margin: 24px 10px 40px;
  }
  .seo-content h2 {
    font-size: 20px;
  }
}