@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --nxf-blue-dark:   #0A1628;
  --nxf-blue-main:   #0055B3;
  --nxf-blue-mid:    #0066CC;
  --nxf-blue-light:  #0080FF;
  --nxf-blue-pale:   #E8F2FF;
  --nxf-blue-palest: #F0F6FF;
  --nxf-white:       #FFFFFF;
  --nxf-gray-100:    #F7F9FC;
  --nxf-gray-200:    #EEF2F7;
  --nxf-gray-300:    #D8E2EE;
  --nxf-gray-500:    #8899AA;
  --nxf-gray-700:    #445566;
  --nxf-gray-900:    #1A2533;
  --nxf-success:     #0D9E5C;
  --nxf-error:       #D63030;
  --nxf-radius:      12px;
  --nxf-font:        'Outfit', sans-serif;
  --nxf-trans:       all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Wrapper ── */
.nxf-wrapper {
  font-family: var(--nxf-font);
  max-width: 780px;
  margin: 0 auto;
  padding: 0 0 60px;
  color: var(--nxf-gray-900);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}
.nxf-wrapper *, .nxf-wrapper *::before, .nxf-wrapper *::after {
  box-sizing: border-box;
}

/* ── Progress bar ── */
.nxf-progress-bar-outer {
  height: 5px;
  background: var(--nxf-gray-200);
  border-radius: 10px;
  margin-bottom: 28px;
  overflow: hidden;
}
.nxf-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--nxf-blue-main), var(--nxf-blue-light));
  border-radius: 10px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 20%;
}

/* ── Steps nav ── */
.nxf-steps-nav {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 36px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.nxf-steps-nav::-webkit-scrollbar { display: none; }
.nxf-step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 54px;
}
.nxf-dot-num {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--nxf-gray-200);
  color: var(--nxf-gray-500);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  transition: var(--nxf-trans);
  border: 2px solid transparent;
}
.nxf-dot-label {
  font-size: 10px; color: var(--nxf-gray-500);
  font-weight: 500; white-space: nowrap;
  transition: var(--nxf-trans);
}
.nxf-step-dot.active .nxf-dot-num {
  background: var(--nxf-blue-main); color: #fff;
  border-color: var(--nxf-blue-light);
  box-shadow: 0 0 0 4px rgba(0,85,179,0.15);
}
.nxf-step-dot.active .nxf-dot-label { color: var(--nxf-blue-main); font-weight: 700; }
.nxf-step-dot.done .nxf-dot-num { background: var(--nxf-success); color: #fff; }
.nxf-step-dot.done .nxf-dot-label { color: var(--nxf-success); }

/* ── Step panels ── */
.nxf-step { display: none; }
.nxf-step.active { display: block; animation: nxfSlideIn 0.35s cubic-bezier(0.4,0,0.2,1); }
.nxf-step.slide-back { animation: nxfSlideBack 0.35s cubic-bezier(0.4,0,0.2,1); }
@keyframes nxfSlideIn   { from { opacity:0; transform:translateX(20px);  } to { opacity:1; transform:translateX(0); } }
@keyframes nxfSlideBack { from { opacity:0; transform:translateX(-20px); } to { opacity:1; transform:translateX(0); } }

/* ── Step header ── */
.nxf-step-header {
  text-align: center;
  padding: 24px 20px 20px;
  margin-bottom: 28px;
  background: linear-gradient(135deg, var(--nxf-blue-palest), #fff);
  border-radius: var(--nxf-radius);
  border: 1px solid var(--nxf-blue-pale);
}
.nxf-step-icon { font-size: 38px; margin-bottom: 8px; line-height: 1; }
.nxf-step-header h2 {
  font-size: 22px; font-weight: 700;
  color: var(--nxf-blue-dark);
  margin: 0 0 6px;
  font-family: var(--nxf-font);
}
.nxf-step-header p { font-size: 14px; color: var(--nxf-gray-500); margin: 0; }

/* ══════════════════════════════════════════
   GRID DE CAMPOS — sistema simplificado
   Todos los campos son 100% ancho en móvil,
   y usamos media query para pantallas grandes
══════════════════════════════════════════ */
.nxf-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* Por defecto (móvil): todos los campos ocupan 100% */
.nxf-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* En pantallas >= 600px aplicamos anchos parciales */
@media (min-width: 600px) {
  .nxf-full       { width: 100%; }
  .nxf-half       { width: calc(50% - 8px); }
  .nxf-third      { width: calc(33.333% - 11px); }
  .nxf-two-thirds { width: calc(66.666% - 5px); }
  .nxf-sixth      { width: calc(16.666% - 14px); min-width: 80px; }
  .nxf-quarter    { width: calc(25% - 12px); }
}

.nxf-fields.nxf-sub {
  padding: 16px;
  background: var(--nxf-gray-100);
  border-radius: 8px;
  border: 1px solid var(--nxf-gray-200);
  margin-top: 8px;
  width: 100%;
}

/* ── Labels ── */
.nxf-field label {
  font-size: 13px; font-weight: 600;
  color: var(--nxf-gray-700); line-height: 1.3;
}
.nxf-req      { color: var(--nxf-blue-light); margin-left: 2px; }
.nxf-optional { color: var(--nxf-gray-500); font-weight: 400; font-size: 12px; }

/* ── Inputs ── */
.nxf-wrapper input[type="text"],
.nxf-wrapper input[type="email"],
.nxf-wrapper input[type="tel"],
.nxf-wrapper input[type="number"],
.nxf-wrapper select,
.nxf-wrapper textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--nxf-font);
  font-size: 14px;
  color: var(--nxf-gray-900);
  background: var(--nxf-white);
  border: 1.5px solid var(--nxf-gray-300);
  border-radius: 8px;
  outline: none;
  transition: var(--nxf-trans);
  appearance: none;
  -webkit-appearance: none;
}
.nxf-wrapper input:focus,
.nxf-wrapper select:focus,
.nxf-wrapper textarea:focus {
  border-color: var(--nxf-blue-mid);
  box-shadow: 0 0 0 3px rgba(0,102,204,0.12);
}
.nxf-wrapper input.nxf-readonly {
  background: var(--nxf-gray-100);
  color: var(--nxf-gray-500);
}
.nxf-wrapper select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230055B3' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.nxf-wrapper textarea {
  resize: vertical; min-height: 90px; line-height: 1.6;
}
.nxf-wrapper input.nxf-invalid,
.nxf-wrapper select.nxf-invalid,
.nxf-wrapper textarea.nxf-invalid {
  border-color: var(--nxf-error);
  box-shadow: 0 0 0 3px rgba(214,48,48,0.1);
}
.nxf-error-msg { font-size: 11px; color: var(--nxf-error); margin-top: -2px; }

/* ── Radio group ── */
.nxf-radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.nxf-radio-opt {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border: 1.5px solid var(--nxf-gray-300);
  border-radius: 8px; cursor: pointer;
  transition: var(--nxf-trans);
  font-size: 14px; font-weight: 500;
  color: var(--nxf-gray-700);
  background: var(--nxf-white);
  user-select: none;
}
.nxf-radio-opt:hover { border-color: var(--nxf-blue-mid); background: var(--nxf-blue-pale); }
.nxf-radio-opt input[type="radio"] {
  width: 16px; height: 16px; margin: 0;
  accent-color: var(--nxf-blue-main);
  cursor: pointer; border: none; padding: 0; flex-shrink: 0;
}
.nxf-radio-opt:has(input:checked) {
  border-color: var(--nxf-blue-main);
  background: var(--nxf-blue-pale);
  color: var(--nxf-blue-main);
}

/* ── Checkbox grid ── */
.nxf-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.nxf-check-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border: 1.5px solid var(--nxf-gray-300);
  border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 500;
  color: var(--nxf-gray-700);
  background: var(--nxf-white);
  user-select: none; transition: var(--nxf-trans);
}
.nxf-check-opt:hover { border-color: var(--nxf-blue-mid); background: var(--nxf-blue-pale); }
.nxf-check-opt input[type="checkbox"] {
  width: 16px; height: 16px; margin: 0;
  accent-color: var(--nxf-blue-main);
  flex-shrink: 0;
}
.nxf-check-opt:has(input:checked) {
  border-color: var(--nxf-blue-main);
  background: var(--nxf-blue-pale);
  color: var(--nxf-blue-main);
}

/* ── Section subtitle ── */
.nxf-section-subtitle {
  width: 100%;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--nxf-blue-main);
  padding: 8px 12px;
  background: var(--nxf-blue-pale);
  border-radius: 6px;
  border-left: 3px solid var(--nxf-blue-main);
  margin-top: 4px;
}

/* ── Foto upload ── */
.nxf-foto-upload { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nxf-foto-preview {
  width: 90px; height: 90px;
  border-radius: 50%;
  border: 2px dashed var(--nxf-gray-300);
  background: var(--nxf-gray-100);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.nxf-foto-placeholder { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--nxf-gray-500); }
.nxf-foto-placeholder span:first-child { font-size: 24px; }
.nxf-foto-preview img { width: 100%; height: 100%; object-fit: cover; }
.nxf-btn-upload {
  padding: 9px 18px; font-family: var(--nxf-font); font-size: 13px; font-weight: 600;
  color: var(--nxf-blue-main); background: var(--nxf-white);
  border: 1.5px solid var(--nxf-blue-mid); border-radius: 8px;
  cursor: pointer; transition: var(--nxf-trans);
}
.nxf-btn-upload:hover { background: var(--nxf-blue-pale); }

/* ── Grado rows ── */
.nxf-grado-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  padding: 14px;
  background: var(--nxf-gray-100);
  border-radius: 8px;
  border: 1px solid var(--nxf-gray-200);
  margin-bottom: 8px;
}
.nxf-grado-row .nxf-field { width: 100%; }
@media (min-width: 600px) {
  .nxf-grado-row .nxf-third      { width: calc(33.333% - 11px); }
  .nxf-grado-row .nxf-sixth      { width: calc(33.333% - 11px); }
  .nxf-grado-row .nxf-grado-remove { width: auto; align-self: flex-end; }
}
.nxf-grado-remove { display: flex; align-items: flex-end; }
.nxf-btn-remove-grado {
  width: 34px; height: 34px;
  background: #fff0f0; border: 1.5px solid #ffcccc;
  border-radius: 8px; cursor: pointer; font-size: 14px;
  transition: var(--nxf-trans);
  display: flex; align-items: center; justify-content: center;
}
.nxf-btn-remove-grado:hover { background: #ffe0e0; border-color: var(--nxf-error); }
.nxf-btn-add {
  padding: 10px 20px; font-family: var(--nxf-font); font-size: 13px; font-weight: 600;
  color: var(--nxf-blue-main); background: var(--nxf-blue-pale);
  border: 1.5px dashed var(--nxf-blue-mid); border-radius: 8px;
  cursor: pointer; width: 100%; transition: var(--nxf-trans);
}
.nxf-btn-add:hover { background: #d0e8ff; border-style: solid; }

/* ── Avisos ── */
.nxf-aviso {
  background: #FFF8E6; border-left: 3px solid #F5A623;
  padding: 12px 16px; border-radius: 0 8px 8px 0;
  font-size: 13px; color: var(--nxf-gray-700); line-height: 1.6;
}
.nxf-aviso-legal {
  background: var(--nxf-blue-palest);
  border: 1px solid var(--nxf-blue-pale);
  padding: 18px 20px; border-radius: 8px;
  font-size: 13px; line-height: 1.7; color: var(--nxf-gray-700);
  max-height: 200px; overflow-y: auto;
}
.nxf-aviso-legal::-webkit-scrollbar { width: 4px; }
.nxf-aviso-legal::-webkit-scrollbar-thumb { background: var(--nxf-blue-mid); border-radius: 4px; }

/* ── Hint ── */
.nxf-hint { font-size: 12px; color: var(--nxf-gray-500); margin: 0; line-height: 1.5; }
.nxf-hint-sm { font-size: 11px; }

/* ── Firma canvas ── */
.nxf-firma-container {
  border: 2px solid var(--nxf-gray-300);
  border-radius: 10px; overflow: hidden; background: #fff;
  transition: var(--nxf-trans);
}
.nxf-firma-container.signing { border-color: var(--nxf-blue-mid); box-shadow: 0 0 0 3px rgba(0,102,204,0.12); }
#nxdip-firma-canvas {
  display: block; width: 100%; height: 180px; cursor: crosshair; touch-action: none;
}
.nxf-firma-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-top: 1px solid var(--nxf-gray-200);
  background: var(--nxf-gray-100);
}
.nxf-btn-secondary {
  padding: 6px 14px; font-family: var(--nxf-font); font-size: 12px; font-weight: 600;
  color: var(--nxf-gray-700); background: var(--nxf-white);
  border: 1.5px solid var(--nxf-gray-300); border-radius: 6px;
  cursor: pointer; transition: var(--nxf-trans);
}
.nxf-btn-secondary:hover { background: var(--nxf-gray-200); }
.nxf-firma-status { font-size: 12px; color: var(--nxf-gray-500); font-weight: 500; }
.nxf-firma-status.done { color: var(--nxf-success); }

/* ── Nav buttons ── */
.nxf-nav-buttons {
  display: flex; justify-content: space-between;
  align-items: center; margin-top: 32px; gap: 14px;
}
.nxf-btn {
  padding: 13px 28px; font-family: var(--nxf-font);
  font-size: 15px; font-weight: 600; border-radius: 10px;
  cursor: pointer; border: none; outline: none;
  transition: var(--nxf-trans);
}
.nxf-btn-prev {
  background: var(--nxf-white); color: var(--nxf-gray-700);
  border: 1.5px solid var(--nxf-gray-300);
}
.nxf-btn-prev:hover { background: var(--nxf-gray-100); }
.nxf-btn-next {
  background: linear-gradient(135deg, var(--nxf-blue-main), var(--nxf-blue-light));
  color: var(--nxf-white); margin-left: auto;
  box-shadow: 0 4px 16px rgba(0,85,179,0.25);
}
.nxf-btn-next:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,85,179,0.35); }
.nxf-btn-submit {
  background: linear-gradient(135deg, #0A8A50, #0DB567);
  color: var(--nxf-white); margin-left: auto;
  box-shadow: 0 4px 16px rgba(13,181,103,0.3);
  min-width: 200px; text-align: center;
}
.nxf-btn-submit:hover { transform: translateY(-1px); }
.nxf-btn-submit:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

/* ── Success screen ── */
.nxf-success { text-align: center; padding: 60px 30px; }
.nxf-success-icon { font-size: 72px; margin-bottom: 20px; }
.nxf-success h2 { font-size: 26px; font-weight: 700; color: var(--nxf-blue-dark); margin: 0 0 14px; }
.nxf-success p  { font-size: 16px; color: var(--nxf-gray-700); margin: 0 0 10px; line-height: 1.6; }
.nxf-success-sub { font-size: 14px !important; color: var(--nxf-gray-500) !important; }

/* ── Prog info card ── */
.nxdip-prog-card {
  background: var(--nxf-blue-pale);
  border: 1.5px solid #b5d4f4;
  border-radius: 10px; padding: 16px 20px;
  animation: nxfSlideIn 0.3s ease;
}
.nxdip-prog-card-title {
  font-size: 15px; font-weight: 700;
  color: var(--nxf-blue-dark); margin-bottom: 10px; line-height: 1.4;
}
.nxdip-prog-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.nxdip-prog-item { display: flex; flex-direction: column; gap: 2px; }
.nxdip-prog-item-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--nxf-blue-mid);
}
.nxdip-prog-item-val { font-size: 13px; color: var(--nxf-blue-dark); font-weight: 500; }
.nxdip-prog-beca {
  grid-column: 1 / -1;
  background: #EDFBF4; border-left: 3px solid #0D9E5C;
  padding: 8px 12px; border-radius: 0 6px 6px 0;
  font-size: 13px; color: #0a5c38; font-weight: 500;
}

/* ── Contenedor especial para grados ── */
#nxdip-grados-container { width: 100%; }