/* =======================================================
   IMPORTAR FUENTE BLINKER DESDE GOOGLE FONTS
   ======================================================= */
@import url('https://fonts.googleapis.com/css2?family=Blinker:wght@300;400;600;700&display=swap');

/* =======================================================
   FORMULARIOS KYC (Humanas + Jurídicas)
   Compatible con #kycForm y #kycJuridicasForm
   ======================================================= */

#kycForm,
#kycJuridicasForm {
  width: 100%;
  background: transparent;
  font-family: "Blinker", sans-serif;
}

/* TÍTULOS */
#kycForm .section-title,
#kycJuridicasForm .section-title {
  font-size: 26px;
  font-weight: 300;
  margin: 0 0 20px;
  padding-top: 24px;
  border-top: 1px solid #316EB7;
  color: #333333;
  text-transform: none !important;
}

/* GRID */
#kycForm .form-grid,
#kycJuridicasForm .form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px 20px;
  margin-bottom: 35px;
}

#kycForm .form-group.full,
#kycJuridicasForm .form-group.full {
  grid-column: 1 / 3;
}

/* LABELS */
#kycForm .form-group label:not(.checkbox-item),
#kycJuridicasForm .form-group label:not(.checkbox-item) {
  display: inline-block;
  font-weight: 400;
  margin-bottom: 6px;
  color: #1a2730;
}

/* INPUTS */
#kycForm input[type="text"],
#kycJuridicasForm input[type="text"],
#kycForm input[type="email"],
#kycJuridicasForm input[type="email"],
#kycForm input[type="date"],
#kycJuridicasForm input[type="date"],
#kycForm input[type="number"],
#kycJuridicasForm input[type="number"],
#kycForm select,
#kycJuridicasForm select,
#kycForm textarea,
#kycJuridicasForm textarea {
  width: 100%;
  padding: 14px 18px;
  font-size: 14px;
  border: 1px solid #C9C9C9;
  border-radius: 30px;
  background: #ffffff;
  transition: all 0.2s ease;
}

/* FOCUS */
#kycForm input:focus,
#kycJuridicasForm input:focus,
#kycForm textarea:focus,
#kycJuridicasForm textarea:focus {
  border-color: #3498db;
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(52,152,219,0.15);
}

/* TEXTAREAS */
#kycForm textarea,
#kycJuridicasForm textarea {
  min-height: 100px;
  resize: vertical;
  border-radius: 20px;
}

/* PÁRRAFOS CONTEXTUALES */
#kycForm .field-hint,
#kycJuridicasForm .field-hint {
  margin-bottom: 8px !important;
}
#kycForm .field-hint:not(.field-hint + .field-hint),
#kycJuridicasForm .field-hint:not(.field-hint + .field-hint) {
  margin-top: 8px;
}
#kycForm .field-hint:not(:has(+ .field-hint)),
#kycJuridicasForm .field-hint:not(:has(+ .field-hint)) {
  margin-bottom: 35px !important;
}

/* SUBTITULOS */
#kycForm .subsection-title,
#kycJuridicasForm .subsection-title {
  font-size: 22px;
  font-weight: 400;
  margin: 10px 0 20px;
  color: #1a2730;
}

/* REQUERIDOS */
#kycForm .req,
#kycJuridicasForm .req {
  color: #e74c3c;
}

/* PASOS */
#kycForm .kyc-step,
#kycJuridicasForm .kyc-step {
  display: none;
}

#kycForm .kyc-step.is-active,
#kycJuridicasForm .kyc-step.is-active {
  display: block;
}

#kycForm .kyc-step,
#kycJuridicasForm .kyc-step {
  padding-top: 6px;
}

#kycForm .kyc-steps-nav,
#kycJuridicasForm .kyc-steps-nav {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 18px;
  margin: 15px 0 35px;
  overflow: hidden;
}

#kycForm .prep-list label,
#kycJuridicasForm .prep-list label {
  font-weight: 600;
  font-size: 16px;
}

#kycForm .prep-list p,
#kycJuridicasForm .prep-list p {
  margin: 4px 0 12px;
}

#kycForm .prep-details,
#kycJuridicasForm .prep-details {
  margin: 6px 0 10px;
  background: #f7f7f7;
  border-radius: 12px;
  padding: 10px 12px;
}

#kycForm .prep-details summary,
#kycJuridicasForm .prep-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #253C58;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#kycForm .prep-details summary::-webkit-details-marker,
#kycJuridicasForm .prep-details summary::-webkit-details-marker {
  display: none;
}

#kycForm .prep-details summary::marker,
#kycJuridicasForm .prep-details summary::marker {
  content: "";
}

#kycForm .prep-details summary::before,
#kycJuridicasForm .prep-details summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 6px solid #253C58;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transition: transform 0.2s ease;
}

#kycForm .prep-details[open] summary::before,
#kycJuridicasForm .prep-details[open] summary::before {
  transform: rotate(90deg);
}

#kycForm .prep-details-body,
#kycJuridicasForm .prep-details-body {
  margin-top: 12px;
}

#kycForm .prep-groups,
#kycJuridicasForm .prep-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 28px;
}

#kycForm .prep-group strong,
#kycJuridicasForm .prep-group strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #253C58;
  margin-bottom: 2px;
}

#kycForm .prep-group p,
#kycJuridicasForm .prep-group p {
  font-size: 12px !important;
  color: #666 !important;
  margin: 0 !important;
  line-height: 1.4;
}

@media (max-width: 600px) {
  #kycForm .prep-groups,
  #kycJuridicasForm .prep-groups {
    grid-template-columns: 1fr;
  }
}

#kycForm .prep-details-body h3,
#kycJuridicasForm .prep-details-body h3 {
  font-size: 15px;
  margin: 10px 0 6px;
}

#kycForm .prep-details-body ul,
#kycJuridicasForm .prep-details-body ul {
  margin: 0 0 10px 18px;
  padding: 0;
}

#kycForm .prep-details-body li,
#kycJuridicasForm .prep-details-body li {
  margin: 3px 0;
  font-size: 13px;
}

#kycForm .prep-docs-alert,
#kycJuridicasForm .prep-docs-alert {
  background: #EEF2FB;
  border: 1px solid #386CB4;
  border-radius: 10px;
  padding: 16px 18px;
}

#kycForm .prep-docs-alert label,
#kycJuridicasForm .prep-docs-alert label {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 15px;
  color: #1a2730;
}

#kycForm .prep-docs-alert p,
#kycJuridicasForm .prep-docs-alert p {
  margin: 6px 0 10px;
  color: #253C58;
  font-size: 14px;
}

#kycForm .prep-docs-list,
#kycJuridicasForm .prep-docs-list {
  margin: 0 0 0 18px;
  padding: 0;
}

#kycForm .prep-docs-list li,
#kycJuridicasForm .prep-docs-list li {
  margin: 5px 0;
  font-size: 14px;
  color: #253C58;
}

#kycForm .kyc-step-tab,
#kycJuridicasForm .kyc-step-tab {
  background: #f2f2f2;
  border: none;
  color: #1a2730;
  border-radius: 18px;
  padding: 18px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s ease;
  text-align: left;
  min-width: 0;
  min-height: 150px;
}

#kycForm .kyc-step-tab.is-active,
#kycJuridicasForm .kyc-step-tab.is-active {
  color: #1a2730;
  background: #e9e9e9;
}

#kycForm .step-circle,
#kycJuridicasForm .step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #253C58;
  color: #253C58;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  background: transparent;
  grid-column: 1 / 2;
  grid-row: 1 / 2;
}

#kycForm .kyc-step-tab.is-active .step-circle,
#kycJuridicasForm .kyc-step-tab.is-active .step-circle {
  border-color: #253C58;
  background: #253C58;
  color: #ffffff;
}

#kycForm .step-text,
#kycJuridicasForm .step-text {
  color: inherit;
  font-weight: 500;
  font-size: 18px;
  grid-column: 1 / -1;
  grid-row: 2 / 3;
  white-space: normal;
  overflow-wrap: anywhere;
}

#kycForm .step-badge,
#kycJuridicasForm .step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  text-transform: lowercase;
  background: #bdbdbd;
  color: #ffffff;
  grid-column: 1 / -1;
  grid-row: 3 / 4;
  align-self: end;
  width: fit-content;
}

#kycForm .kyc-step-tab.is-complete .step-badge,
#kycJuridicasForm .kyc-step-tab.is-complete .step-badge {
  background: #386CB4;
  color: #ffffff;
}

#kycForm .kyc-step-tab.is-active .step-badge,
#kycJuridicasForm .kyc-step-tab.is-active .step-badge {
  background: #bdbdbd;
}


#kycForm .step-actions,
#kycJuridicasForm .step-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 10px;
}

#kycForm .step-actions .submit-btn,
#kycJuridicasForm .step-actions .submit-btn {
  margin-top: 0;
  padding: 10px 18px;
  font-size: 14px;
  border-radius: 22px;
}

#kycForm .step-actions .prev-step,
#kycJuridicasForm .step-actions .prev-step {
  background: #bdbdbd;
  color: #ffffff;
  margin-right: auto;
  box-shadow: none;
}

#kycForm .step-actions .prev-step:hover,
#kycJuridicasForm .step-actions .prev-step:hover {
  background: #a9a9a9;
  transform: translateY(-1px);
}

#kycForm .step-actions .next-step,
#kycJuridicasForm .step-actions .next-step,
#kycForm .step-actions .submit-btn[type="submit"],
#kycJuridicasForm .step-actions .submit-btn[type="submit"] {
  background: #386CB4;
}

#kycForm .step-actions .next-step:hover,
#kycJuridicasForm .step-actions .next-step:hover,
#kycForm .step-actions .submit-btn[type="submit"]:hover,
#kycJuridicasForm .step-actions .submit-btn[type="submit"]:hover {
  background: #2f5da0;
}

/* =======================================================
   ESTILOS MEJORADOS PARA FILE INPUTS
   ======================================================= */

/* Ocultar el input file nativo */
#kycForm input[type="file"],
#kycJuridicasForm input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Contenedor del input personalizado */
.file-input-wrapper {
  width: 100%;
}

/* Label personalizado que actúa como botón */
.file-input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #f4f6f9;
  color: #316EB7;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  border: 1.5px dashed #316EB7;
  box-shadow: none;
  width: 100%;
  box-sizing: border-box;
  letter-spacing: 0.01em;
}

.file-input-label .file-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-self: center;
}

.file-input-label:hover {
  background: #eaf1fb;
  border-color: #1a5fa8;
  color: #1a5fa8;
}

.file-input-label:active {
  background: #dce8f7;
}

/* Icono del botón */
.file-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Contenedor de preview de archivos */
.file-preview {
  margin-top: 15px;
  display: none;
}

.file-preview.has-files {
  display: block;
}

/* Lista de archivos */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Cada item de archivo */
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.file-item:hover {
  background: #eeeeee;
  border-color: #d3d3d3;
}

/* Info del archivo */
.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.file-info svg {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
}

.file-info > div {
  flex: 1;
  min-width: 0;
}

/* Nombre del archivo */
.file-name {
  font-size: 14px;
  font-weight: 500;
  color: #2d3748;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

/* Tamaño del archivo */
.file-size {
  font-size: 12px;
  color: #718096;
}

/* Botón para remover archivo */
.remove-file {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  color: #e53e3e;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.remove-file:hover {
  background: #fee;
  border-color: #fc8181;
  transform: scale(1.1);
}

.remove-file:active {
  transform: scale(0.95);
}

/* ERRORES */
#kycForm .input-error,
#kycJuridicasForm .input-error {
  border-color: #e74c3c !important;
  background-color: #fff5f5 !important;
}

#kycForm .form-group.input-error label,
#kycJuridicasForm .form-group.input-error label {
  color: #e74c3c;
}

#kycForm .form-group.input-error input,
#kycJuridicasForm .form-group.input-error input,
#kycForm .form-group.input-error select,
#kycJuridicasForm .form-group.input-error select,
#kycForm .form-group.input-error textarea,
#kycJuridicasForm .form-group.input-error textarea {
  border-color: #e74c3c !important;
  background-color: #fff5f5 !important;
}

/* Error para file inputs */
#kycForm .file-input-wrapper.input-error .file-input-label,
#kycJuridicasForm .file-input-wrapper.input-error .file-input-label {
  border: 2px solid #1a5fa8;
  background: linear-gradient(135deg, #316EB7 0%, #1a5fa8 100%);
}

#kycForm .form-error,
#kycJuridicasForm .form-error {
  display: block;
  margin-top: 6px;
  color: #e74c3c;
  font-size: 13px;
  font-weight: 500;
}

/* BOTONES DE SUBMIT */
#kycForm .submit-btn,
#kycJuridicasForm .submit-btn {
  margin-top: 30px; 
  padding: 16px 38px;
  background: #316EB7;
  color: #fff;
  font-size: 17px;
  border: none;
  border-radius: 28px;
  cursor: pointer;
  transition: 0.25s ease;
  display: block;
}

#kycForm .submit-btn:hover,
#kycJuridicasForm .submit-btn:hover {
  background: #2d85c7;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(49, 110, 183, 0.3);
}

#kycForm .submit-btn:active,
#kycJuridicasForm .submit-btn:active {
  transform: translateY(0);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  #kycForm .form-grid,
  #kycJuridicasForm .form-grid {
    grid-template-columns: 1fr;
  }

  #kycForm .form-group.full,
  #kycJuridicasForm .form-group.full {
    grid-column: 1 / 2;
  }
  
  /* Campos de fecha con ancho limitado en mobile */
  #kycForm input[type="date"],
  #kycJuridicasForm input[type="date"] {
    width: auto;
    max-width: 280px;
    min-width: 200px;
  }
  
  .file-input-label {
    width: auto;
    max-width: 100%;
    justify-content: center;
    align-items: center;
  }
  
  .file-item {
    padding: 10px 12px;
  }
  
  .file-name {
    font-size: 13px;
  }
  
  .file-size {
    font-size: 11px;
  }
}

@media (max-width: 768px) {
  #kycForm .kyc-steps-nav,
  #kycJuridicasForm .kyc-steps-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 12px;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
  }

  #kycForm .kyc-step-tab,
  #kycJuridicasForm .kyc-step-tab {
    min-width: 220px;
    scroll-snap-align: start;
  }

  #kycForm .step-text,
  #kycJuridicasForm .step-text {
    font-size: 15px;
  }

  #kycForm .step-badge,
  #kycJuridicasForm .step-badge {
    font-size: 10px;
    padding: 3px 8px;
  }
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-weight: 500 !important;
  margin: 8px 0;
  font-size: 1em;
  line-height: 1.6;
}

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ===== TITLE NOTES (parentheticals) ===== */
.title-note {
  font-weight: 300;
  font-size: 0.82em;
  opacity: 0.7;
  font-style: italic;
}

/* ===== SUBMIT SPINNER ===== */
@keyframes kyc-rotate {
  to { transform: rotate(360deg); }
}
.kyc-spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: kyc-rotate 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}
