/* ===== Base ===== */
.mf-form {
  font-family: "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  color: #222;
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 20px 24px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  overflow: hidden;

  --mf-progress-color: #0073aa;
  --mf-title-size: 1.1rem;
  --mf-input-extra: 7px;
  --mf-field-margin: 28px;
  --mf-input-weight: 400;
  --mf-title-weight: 400;
  --mf-side-gap: 25px;

  --mf-fab-size: 38px;
  --mf-fab-gap: 0;
}
.mf-form.fullscreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Barra de progreso ===== */
.mf-progress {
  --track: color-mix(in oklab, var(--mf-progress-color) 50%, transparent);
  height: 4px;
  width: 100%;
  background: var(--track);
  border-radius: 999px;
  overflow: hidden;
  margin: 2px 0 var(--mf-field-margin) 0;
}
.mf-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--mf-progress-color);
  transition: width 0.35s ease;
}

/* ===== Contenedor preguntas ===== */
.mf-form-inner {
  position: relative;
  height: var(--mf-inner-h, 340px);
  overflow: hidden;
  z-index: 1;
  margin-bottom: var(--mf-field-margin);
  padding-bottom: calc(var(--mf-field-margin) + var(--mf-fab-size) + 16px);
}
.mf-question {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s ease, opacity 0.45s ease;
  transform: translateY(20px);
  z-index: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 var(--mf-side-gap);
  box-sizing: border-box;
}
.mf-question.active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ===== Animaciones ===== */
.mf-form.anim-fadeUp .mf-question { transform: translateY(20px); }
.mf-form.anim-fadeUp .mf-question.active { transform: translateY(0); }
.mf-form.anim-slideLR.dir-forward .mf-question { transform: translateX(30px); }
.mf-form.anim-slideLR.dir-forward .mf-question.active { transform: translateX(0); }
.mf-form.anim-slideLR.dir-back .mf-question { transform: translateX(-30px); }
.mf-form.anim-slideLR.dir-back .mf-question.active { transform: translateX(0); }

/* ===== Títulos ===== */
.mf-title {
  font-weight: var(--mf-title-weight);
  margin-bottom: 10px;
  font-size: calc(var(--mf-title-size) + 2px);
  text-align: left;
  width: 100%;
}

/* ===== Opciones ===== */
/* Opciones de radio estilo tarjeta, ajustadas al ancho del contenido */
.mf-question label {
  display: block;
  font-weight: var(--mf-input-weight);
  margin: 10px 0;
  color: var(--mf-progress-color);
  max-width: 800px;
  font-size: 15px;
}

.mf-question label input[type="radio"],
.mf-question label input[type="checkbox"] {
  display: inline-block;
  margin-right: 10px;
}

/* ===== Inputs (solo línea inferior) ===== */
.mf-question input:not([type="radio"]):not([type="checkbox"]),
.mf-question select,
.mf-question textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  padding: 10px 4px;
  font-size: calc(var(--mf-title-size) + var(--mf-input-extra));
  font-weight: var(--mf-input-weight);
  color: var(--mf-progress-color);
  border: none;
  border-bottom: 2px solid #ccc;   /* solo línea inferior */
  border-radius: 0;                /* sin bordes redondeados */
  background: transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
  box-shadow: none;
}
.mf-question input:focus,
.mf-question select:focus,
.mf-question textarea:focus {
  border-color: var(--mf-progress-color);
  outline: none;
}

/* Placeholders */
.mf-question input::placeholder,
.mf-question textarea::placeholder {
  color: color-mix(in oklab, var(--mf-progress-color), #000 20%);
  opacity: .55;
}

/* ===== Botón Aceptar (con ↵) ===== */
.mf-accept {
  display: inline-block;
  margin-top: 16px;
  padding: 14px 22px;
  border: none;
  background: var(--mf-progress-color);
  color: #fff;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1.05rem;
  box-shadow: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.mf-accept::after {
  content: " ↵";   /* añade el símbolo */
  font-weight: 400;
}
.mf-accept:hover { transform: translateY(-1px); }

/* ===== FAB flechas ===== */
.mf-fab {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: row;
  gap: var(--mf-fab-gap);
  z-index: 5;
}
.mf-fab .mf-prev,
.mf-fab .mf-next {
  width: var(--mf-fab-size);
  height: var(--mf-fab-size);
  border-radius: 8px;
  border: none;
  background: var(--mf-progress-color);
  box-shadow: none;
  cursor: pointer;
  position: relative;
}
.mf-fab .mf-prev::before,
.mf-fab .mf-next::before {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
}
.mf-fab .mf-prev::before {
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 14l6-6 6 6' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.mf-fab .mf-next::before {
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 10l6 6 6-6' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.mf-fab .mf-submit { display: none; }

/* ===== Final ===== */
.mf-final {
  text-align: center;
  font-size: 1.4rem;
  padding: 40px 20px;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .mf-form { padding: 16px; border-radius: 12px; }
  .mf-fab { right: 12px; }
  :root, .mf-form { --mf-fab-size: 36px; }
}

/* Avisos de error inline */
.mf-error {
  display: none;
  margin-top: 8px;
  font-size: .92rem;
  line-height: 1.3;
  color: #e11d48; /* rojo discreto */
}

/* Borde inferior rojo/verde ya lo fuerza el JS con inline style */
.mf-question .has-error {
  /* por si algún tema sobreescribe, damos pista visual extra */
  background-image: linear-gradient(to bottom, transparent calc(100% - 2px), #e11d48 0);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

/* Radios como recuadros */
.mf-question input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--mf-progress-color, #0073aa);
  border-radius: 3px;
  margin-right: 8px;
  cursor: pointer;
  vertical-align: middle;
}

.mf-question label {
  display: flex;
  align-items: center;   /* centra input y texto en vertical */
  line-height: 1.4;
  margin: 4px 0;         /* separación entre opciones */
  cursor: pointer;
  max-width: 800px;
  font-size: 15px;
}

.mf-question input[type="radio"]:checked {
  background-color: var(--mf-progress-color, #0073aa);
  border-color: var(--mf-progress-color, #0073aa);
}



/* === Radios: tarjeta compacta, ancho al contenido, en columna === */

/* Tarjeta por opción (solo las que contienen un radio) */
.mf-question label:has(> input[type="radio"]) {
  display: block !important;          /* columna (una debajo de otra) */
  width: fit-content;                  /* se ajusta al ancho del texto */
  max-width: 100%;
  padding: 6px 10px;
  margin: 6px 24px 6px 0;             /* más margen a la derecha */
  border: 2px solid rgba(0, 115, 170, 0.2); /* fallback */
  border: 2px solid rgb(from var(--mf-progress-color) r g b / 0.2);
  border-radius: 6px;
  line-height: 1.4;
  cursor: pointer;
  align-items: center;
  gap: 8px;
}

/* Cuadrito del radio */
.mf-question label:has(> input[type="radio"]) > input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--mf-progress-color, #0073aa);
  border-radius: 3px;
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 8px;                  /* separación con el texto */
  cursor: pointer;
}

/* Radio activo */
.mf-question label:has(> input[type="radio"]) > input[type="radio"]:checked {
  background-color: var(--mf-progress-color, #0073aa);
  border-color: var(--mf-progress-color, #0073aa);
}



/* === Igualar ancho de todas las opciones de un mismo campo de radio === */
.mf-question {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* mantiene alineado a la izquierda */
}

.mf-question label:has(> input[type="radio"]) {
  display: flex !important;
  width: 100%;                 /* todas las opciones con el mismo ancho */
  max-width: 400px;            /* límite opcional, ajústalo o bórralo */
  box-sizing: border-box;
}

.mf-submit, .mf-next, .mf-prev {
  background-color: #2dd4bf; /* mismo color que la barra de progreso */
  border-color: #2dd4bf;
  color: #fff;
}

/* Forzamos color del botón igual a la barra de progreso */
.mf-form .mf-submit, .mf-form .mf-next, .mf-form .mf-prev {
  background-color: #2dd4bf !important;
  border-color: #2dd4bf !important;
  color: #fff !important;
}

/* === Forzamos botones del formulario a usar el color de la barra === */
.mf-form button[type="submit"],
.mf-form input[type="submit"],
.mf-form .mf-submit,
.mf-form .mf-next,
.mf-form .mf-prev,
.mf-form .mf-btn,
.mf-form button,
.mf-form .button {
  background-color: var(--mf-progress-color, #0073aa) !important;
  border-color: var(--mf-progress-color, #0073aa) !important;
  color: #fff !important;
  box-shadow: none !important;
  filter: none !important;
}