/* =========================
   BASE GENERAL
   ========================== */

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: #f2f5fb;
  color: #1f2933;
  margin: 0;
  padding: 0;
}

form {
  max-width: 1080px;
  margin: 24px auto 40px;
  padding: 24px 24px 40px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

/* =========================
   SECCIONES Y CABECERAS
   ========================== */

.section {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e3e8f3;
}

.section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f3b63;
}

.section-tag {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #e3f7ff;
  color: #006b8f;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.section-subtitle {
  font-size: 14px;
  font-weight: 600;
  color: #273b54;
  margin-top: 14px;
  margin-bottom: 6px;
}

/* =========================
   GRIDS
   ========================== */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 16px;
}

@media (max-width: 900px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* =========================
   CAMPOS DE FORMULARIO
   ========================== */

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.field label {
  font-weight: 500;
  color: #37455b;
}

.field input,
.field select,
.field textarea {
  font-family: inherit;
  font-size: 13px;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid #ccd4e4;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease;
}

.field textarea {
  min-height: 70px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: #00b5e6;
  box-shadow: 0 0 0 1px rgba(0, 181, 230, 0.35);
  background-color: #f8fcff;
}

/* Placeholder más suave */
::placeholder {
  color: #9aa4b5;
}

/* =========================
   HINTS Y MENSAJES
   ========================== */

.hint {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
}

/* Error de suma de participaciones */
#accionistas_error {
  display: none;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #fdecea;
  border: 1px solid #f5c2c0;
  color: #b00020;
  font-size: 13px;
  font-weight: 600;
}

/* Mensaje de la sección 10 (PEP) */
#seccion10_msg {
  font-size: 12px;
  color: #4b5563;
}

/* =========================
   BOTONES
   ========================== */

button,
input[type="submit"] {
  font-family: inherit;
  font-size: 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}

/* MISMO ESTILO PARA:
   - Agregar accionista (Sección 7)
   - Agregar banco (Sección 9)
   - Agregar actividad económica (Sección 5) */
#add-shareholder-btn,
#add-bank-btn,
#add-activity-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  margin-top: 14px;
  background: #00b5e6;
  color: #ffffff;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(0, 181, 230, 0.35);
  border-radius: 999px;
  border: 1px solid #00a2cc;
  transition: background 0.15s ease, transform 0.1s ease,
    box-shadow 0.15s ease;
}

#add-shareholder-btn:hover,
#add-bank-btn:hover,
#add-activity-btn:hover {
  background: #009ec9;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 152, 207, 0.4);
}

#add-shareholder-btn:disabled,
#add-bank-btn:disabled,
#add-activity-btn:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

/* Botones de tipo submit (solo los que NO usan el estilo Traxwire principal) */
button[type="submit"]:not(.btn-primary-trax),
input[type="submit"]:not(.btn-primary-trax) {
  background: #214061;
  color: #ffffff;
  padding: 9px 20px;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(33, 64, 97, 0.35);
}

button[type="submit"]:not(.btn-primary-trax):hover,
input[type="submit"]:not(.btn-primary-trax):hover {
  background: #1a344f;
}

/* =========================
   SECCIÓN 7: DETALLES EXTRA
   ========================== */

/* Separador sutil para accionistas agregados dinámicamente */
#accionista4,
#accionista5 {
  border-top: 1px dashed #dde2eb;
  padding-top: 12px;
  margin-top: 16px;
}

/* =========================
   TARJETAS DE HIJOS - TRAXWIRE STYLE
   ========================== */

.hijos-wrapper {
  margin-top: 12px;
}

/* Tarjeta de cada hijo */
.hijo-card {
  border: 1px solid #b9e7ff;           /* borde azul claro */
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: #f7fbff;                 /* fondo suave azulado */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

/* Encabezado de cada tarjeta (icono + chip) */
.hijo-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

/* Icono de persona */
.hijo-header::before {
  content: "👤";
  font-size: 16px;
  opacity: 0.85;
}

/* Chip “Hijo 1 / Hijo 2 / …” */
.hijo-index {
  font-size: 13px;
  font-weight: 600;
  color: #1f3b63;                      /* azul más oscuro */
  padding: 4px 12px;
  border-radius: 999px;
  background: #dceeff;                 /* azul claro */
}

/* Grid interno de campos: Nombre | Edad | Domicilio */
.hijo-grid {
  display: grid;
  grid-template-columns: 2.2fr 0.5fr 2.3fr; /* Nombre ancho, edad compacta, domicilio ancho */
  gap: 14px;
  align-items: end;
}

/* Que los inputs aprovechen la columna */
.hijo-grid .field input[type="text"],
.hijo-grid .field input[type="number"] {
  width: 100%;
}

/* Edad aún más compacta en desktop */
.hijo-grid .field:nth-child(2) input[type="number"] {
  max-width: 90px;
}

/* Línea/divisor sutil entre tarjetas de hijos (efecto de pila) */
.hijo-card:not(:last-child) {
  border-bottom: 1px solid #d9e4f5;
}

/* Responsive: en pantallas pequeñas, apilar columnas */
@media (max-width: 768px) {
  .hijo-grid {
    grid-template-columns: 1fr;
  }

  .hijo-grid .field:nth-child(2) input[type="number"] {
    max-width: 120px;
  }
}

/* =========================
   TOOLTIP SIMPLE EN LABELS
   ========================== */

/* Labels con atributo title se ven “ayudosos” */
label[title] {
  border-bottom: 1px dotted #7b8aa5;
  cursor: help;
}

/* =========================
   OTROS AJUSTES SUAVES
   ========================== */

/* Espacio entre sección de control y comentarios finale */
#propietarios_reales_extra {
  margin-bottom: 8px;
}

textarea[name="accionistas_comentarios"] {
  min-height: 80px;
}
/* ==========================
   BOTÓN PRINCIPAL TRAXWIRE (REUTILIZABLE)
   ========================== */
.btn-primary-trax {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: #00b5e6;
  color: #ffffff;
  font-weight: 500;
  font-size: 14px;
  border-radius: 999px;
  border: 1px solid #00a2cc;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 181, 230, 0.35);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-primary-trax:hover {
  background: #009ec9;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 152, 207, 0.4);
}

.btn-primary-trax:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}
/* ==========================
   CHECKBOX CORPORATIVO TRAXWIRE
   ========================== */

.trax-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #37455b;
  user-select: none;
}

.trax-checkbox input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #00b5e6;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.trax-checkbox input[type="checkbox"]:checked {
  background: #00b5e6;
  border-color: #009ec9;
}

.trax-checkbox input[type="checkbox"]:checked::after {
  content: "✔";
  font-size: 13px;
  color: white;
  position: absolute;
  top: -1px;
  left: 3px;
}
/* ==========================
   CHECKBOX ESTILO TRAXWIRE
   ========================== */

.trax-checkbox {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #273b54;
  user-select: none;
}

.trax-checkbox input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #00b5e6;
  border-radius: 4px;
  background: #ffffff;
  transition: 0.2s ease;
  cursor: pointer;
}

/* ==========================
   AJUSTE DE LA ÚLTIMA SECCIÓN (.section)
   ========================== */
.section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 12px !important; /* reduce el espacio antes de la declaración */
}


/* ==========================
   SECCIÓN ESPECIAL: DECLARACIÓN
   ========================== */
.section-declaracion {
  margin-top: 8px;                 /* distancia ajustada con la sección anterior */
  margin-bottom: 0;
  border: 1px solid #e3e8f3;       /* marco completo */
  border-radius: 10px;
  padding: 16px 20px 18px;         /* padding interno uniforme */
  background: #ffffff;
}


/* ==========================
   CHECKBOX PERSONALIZADO TRAXWIRE
   ========================== */
.trax-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #37455b;
  cursor: pointer;
  user-select: none;
}

.trax-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  border: 2px solid #00b5e6;
  border-radius: 4px;
  appearance: none;
  position: relative;
  background: #ffffff;
  transition: all 0.15s ease;
}

.trax-checkbox input[type="checkbox"]:hover {
  border-color: #009ec9;
}

/* Checkbox activado */
.trax-checkbox input[type="checkbox"]:checked {
  background: #00b5e6;
  border-color: #009ec9;
  box-shadow: 0 0 4px rgba(0, 181, 230, 0.4);
}

.trax-checkbox input[type="checkbox"]:checked::after {
  content: "✔";
  position: absolute;
  left: 4px;
  top: -1px;
  color: white;
  font-size: 13px;
  font-weight: bold;
}
/* ===== MEJORA VISUAL GENERAL ===== */

body {
  background: #f3f7fb;
  font-size: 16px;
  line-height: 1.5;
}

.page {
  max-width: 1180px;
  margin: 32px auto;
  padding: 44px 52px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

header {
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid #e5edf5;
}

.logo img {
  height: 64px !important;
}

.badge {
  background: #e8f8ff;
  color: #007ba7;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 16px;
}

h1 {
  font-size: 32px;
  line-height: 1.2;
  color: #102033;
  margin-bottom: 12px;
}

.subtitle {
  font-size: 17px;
  color: #526174;
  max-width: 980px;
  margin-bottom: 30px;
}

form {
  gap: 28px;
}

.section {
  border: 1px solid #dbe7f3;
  border-radius: 18px;
  padding: 30px 32px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.section-header {
  margin-bottom: 20px;
}

.section-title {
  font-size: 21px;
  color: #173b66;
}

.section-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: #edf8ff;
  color: #007ba7;
  padding: 6px 12px;
}

.section-subtitle {
  font-size: 16px;
  font-weight: 700;
  color: #1f3b63;
  margin-top: 24px;
  margin-bottom: 14px;
}

.grid-2 {
  gap: 20px 28px;
}

.grid-3 {
  gap: 20px 24px;
}

.field {
  gap: 7px;
}

.field label,
label {
  font-size: 14.5px;
  font-weight: 650;
  color: #334155;
}

input,
select,
textarea {
  width: 100%;
  font-size: 15px !important;
  padding: 12px 14px !important;
  border-radius: 11px !important;
  border: 1px solid #cbd8e6 !important;
  background: #ffffff;
}

textarea {
  min-height: 92px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #00aee8 !important;
  box-shadow: 0 0 0 4px rgba(0, 174, 232, 0.16) !important;
}

.check-group {
  gap: 12px 22px;
  margin-top: 12px;
}

.check-item {
  background: #f8fbfe;
  border: 1px solid #e2ebf5;
  border-radius: 12px;
  padding: 10px 12px;
}

button,
.btn-primary-trax,
#add-shareholder-btn,
#add-bank-btn,
#add-activity-btn {
  font-size: 15px !important;
  font-weight: 700 !important;
  padding: 12px 22px !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #00aee8, #00b88f) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 8px 18px rgba(0, 174, 232, 0.28) !important;
}

button:hover,
.btn-primary-trax:hover,
#add-shareholder-btn:hover,
#add-bank-btn:hover,
#add-activity-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(0, 174, 232, 0.35) !important;
}

.footer-actions {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid #e5edf5;
}

.section-declaracion {
  border-radius: 18px;
  padding: 28px 32px;
  background: #f8fcff;
  border: 1px solid #cfeaf7;
}

.small-note {
  margin-top: 18px;
  font-size: 12px;
}

/* Responsive */
@media (max-width: 900px) {
  .page {
    margin: 0;
    padding: 24px 18px;
    border-radius: 0;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  h1 {
    font-size: 26px;
  }

  .section {
    padding: 24px 20px;
  }
}

/* ===== FIX Y MEJORA SECCIÓN 4: CHECKBOXES ===== */

.check-group {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px 18px !important;
  margin-top: 16px;
}

.check-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 14px 16px !important;
  border: 1px solid #dbe7f3 !important;
  border-radius: 14px !important;
  background: #f8fbff !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #24364b !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
  transition: all 0.15s ease;
}

.check-item:hover {
  border-color: #00aee8 !important;
  background: #f0fbff !important;
  transform: translateY(-1px);
}

.check-item input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 5px !important;
  accent-color: #00aee8;
  box-shadow: none !important;
}

/* Para que los inputs normales sigan bien, pero no afecten checkboxes */
input:not([type="checkbox"]),
select,
textarea {
  width: 100%;
}

/* Responsive sección 4 */
@media (max-width: 800px) {
  .check-group {
    grid-template-columns: 1fr !important;
  }
}

.progress-wrap {
  margin: 26px 0 34px;
  padding: 18px 20px;
  border: 1px solid #dbe7f3;
  border-radius: 18px;
  background: linear-gradient(135deg, #f8fcff, #ffffff);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #2f4663;
}

.progress-bar {
  height: 10px;
  background: #e6eef7;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  width: 18%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, #00aee8, #00b88f);
}

.progress-wrap {
  margin: 28px 0 34px;
  padding: 22px 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, #e8f8ff, #f4fffb);
  border: 1px solid #bfeaf7;
  box-shadow: 0 10px 28px rgba(0, 174, 232, 0.12);
}

.progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.progress-top strong {
  font-size: 18px;
  color: #102033;
}

.progress-top p {
  margin: 4px 0 0;
  font-size: 14px;
  color: #5b6b7f;
}

.progress-percent {
  min-width: 64px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: #007ba7;
  background: #ffffff;
  border-radius: 999px;
  padding: 8px 14px;
  border: 1px solid #cceefa;
}

.progress-bar {
  height: 14px;
  background: #d9e8f2;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, #00aee8, #00b88f);
  transition: width 0.25s ease;
}

/* ===== BARRA DE PROGRESO FINTECH ===== */

.progress-wrap {
  margin: 28px 0 34px;
  padding: 22px 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, #e8f8ff, #f4fffb);
  border: 1px solid #bfeaf7;
  box-shadow: 0 10px 28px rgba(0, 174, 232, 0.12);
}

.progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.progress-top strong {
  font-size: 18px;
  color: #102033;
}

.progress-top p {
  margin: 4px 0 0;
  font-size: 14px;
  color: #5b6b7f;
}

.progress-percent {
  min-width: 64px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: #007ba7;
  background: #ffffff;
  border-radius: 999px;
  padding: 8px 14px;
  border: 1px solid #cceefa;
}

.progress-bar {
  height: 14px;
  background: #d9e8f2;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, #00aee8, #00b88f);
  transition: width 0.25s ease;
}

/* Responsive */
@media (max-width: 768px) {
  .progress-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .progress-percent {
    margin-top: 8px;
  }
}