/* ─── Contenedor ──────────────────────────────────────────────────────────── */

.mf-wrap {
  max-width: 540px;
  margin: 2rem auto;
  font-family: inherit;
}

#mf-app {
  margin-top: 0;
}

/* ─── Tipografía ──────────────────────────────────────────────────────────── */

.mf-titulo {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
  color: inherit;
  line-height: 1.2;
}

.mf-descripcion {
  font-size: 0.92rem;
  color: #3ecf8e;
  margin-bottom: 1.75rem;
}

.mf-instruccion {
  font-size: 0.92rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1.25rem;
}

/* ─── Grupos de campo ─────────────────────────────────────────────────────── */

.mf-campo-grupo {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  margin-bottom: 1.25rem;
}

.mf-label {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.mf-req {
  color: #ef4444;
}

/* ─── Inputs y selects ────────────────────────────────────────────────────── */

.mf-wrap .mf-input,
.mf-wrap .mf-select {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1.5px solid #d1d5db !important;
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  background-color: #ffffff !important;
  background-image: none !important;
  color: inherit;
  box-shadow: none !important;
  -webkit-transition: border-color 0.15s, box-shadow 0.15s;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.mf-wrap .mf-input:focus,
.mf-wrap .mf-select:focus {
  outline: none !important;
  border-color: #3ecf8e !important;
  box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.18) !important;
  background-color: #ffffff !important;
}

/* ─── Input con ícono (paso 1) ────────────────────────────────────────────── */

.mf-wrap .mf-input-icon-wrap {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: stretch;
  -ms-flex-align: stretch;
  align-items: stretch;
  border: 1.5px solid #d1d5db;
  border-radius: 12px;
  background-color: #ffffff;
  overflow: hidden;
  -webkit-transition: border-color 0.15s, box-shadow 0.15s;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mf-wrap .mf-input-icon-wrap:focus-within {
  border-color: #3ecf8e;
  box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.18);
}

.mf-wrap .mf-input-icono {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  padding: 0 0.75rem;
  border-right: 1.5px solid #d1d5db;
  color: #9ca3af;
  background-color: #ffffff;
  -ms-flex-negative: 0;
  flex-shrink: 0;
}

/* El input dentro del wrapper hereda el estado sin borde propio */
.mf-wrap .mf-input-icon-wrap .mf-input {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  min-width: 0;
  padding: 0.75rem 0.875rem;
  background-color: #ffffff !important;
  background-image: none !important;
}

/* ─── Chip código de orden ────────────────────────────────────────────────── */

.mf-codigo-chip {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: 0.4rem;
  background-color: #f0fdf9;
  border: 1.5px solid #a7e9cc;
  color: #065f46;
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

/* ─── Hint ────────────────────────────────────────────────────────────────── */

.mf-hint {
  font-size: 0.78rem;
  color: #6b7280;
  margin-top: 0.3rem;
}

/* ─── Botones ─────────────────────────────────────────────────────────────── */

.mf-btn {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  -webkit-transition: background-color 0.15s;
  transition: background-color 0.15s;
  box-sizing: border-box;
}

.mf-btn-primario          { background-color: #3ecf8e; color: #fff; }
.mf-btn-primario:hover    { background-color: #2db87a; color: #fff; }
.mf-btn-primario:disabled { background-color: #a7e9cc; color: #fff; cursor: not-allowed; }

.mf-btn-secundario {
  background-color: transparent;
  color: #3ecf8e;
  border: 1.5px solid #3ecf8e;
}
.mf-btn-secundario:hover {
  background-color: rgba(62, 207, 142, 0.1);
  color: #2db87a;
}

/* Botones de descarga: ancho automático */
.mf-descargas .mf-btn {
  width: auto;
}

.mf-btn-nueva {
  background-color: transparent;
  color: #6b7280;
  border: 1.5px solid #d1d5db;
}
.mf-btn-nueva:hover {
  background-color: #f3f4f6;
  color: #374151;
  border-color: #9ca3af;
}

/* ─── Alertas ─────────────────────────────────────────────────────────────── */

.mf-alerta {
  padding: 0.875rem 1rem;
  border-radius: 12px;
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.mf-alerta-error  { background-color: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.mf-alerta-info   { background-color: #f0fdf9; border: 1px solid #a7e9cc; color: #065f46; }
.mf-alerta-exito  { background-color: #f0fdf9; border: 1px solid #a7e9cc; color: #065f46; }

/* ─── Folio y descargas ───────────────────────────────────────────────────── */

.mf-folio {
  margin: 0.75rem 0;
  font-size: 0.9rem;
}

.mf-descargas {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* ─── Spinner ─────────────────────────────────────────────────────────────── */

.mf-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  -webkit-animation: mf-spin 0.7s linear infinite;
  animation: mf-spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
}

@-webkit-keyframes mf-spin { to { -webkit-transform: rotate(360deg); } }
@keyframes mf-spin          { to { transform: rotate(360deg); } }

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .mf-wrap { margin: 1rem; }
  .mf-descargas {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
  }
  .mf-descargas .mf-btn { width: 100%; }
}
