/* ── feedback.css — encuesta de calidad de la formación ──────────
   Wizard tipo Typeform: una pregunta por pantalla, transición
   vertical, barra de progreso y navegación por teclado.
   Página autocontenida: solo depende de tokens.css + fonts.css +
   base.css (no carga components/layout). */

/* ── Shell de página (100dvh, sin scroll de documento) ── */
.fb-body {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Barra de progreso (borde superior del viewport) ── */
.fb-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--line);
  z-index: 20;
}
.fb-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Cabecera mínima: logo + contador + idioma ── */
.fb-top {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px 12px;
}
.fb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.fb-logo img { width: 34px; height: 34px; display: block; }
.fb-logo span {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
}
.fb-top-right {
  display: flex;
  align-items: center;
  gap: 18px;
}
.fb-count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-dim);
  min-width: 44px;
  text-align: right;
}
.fb-lang {
  font-family: var(--mono);
  font-size: 12px;
  display: flex;
  gap: 6px;
}
.fb-lang a {
  color: var(--ink-mute);
  text-decoration: none;
  transition: color 0.2s ease;
}
.fb-lang a:hover { color: var(--accent); }
.fb-lang a.active { color: var(--ink); }
.fb-lang .sep { color: var(--ink-mute); }

/* ── Viewport de pasos ── */
.fb-main {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
}
.fb-form { position: absolute; inset: 0; }

.fb-step {
  position: absolute;
  inset: 0;
  display: flex;
  overflow-y: auto;
  padding: 32px 28px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(56px);
  transition:
    opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.fb-step.is-above { transform: translateY(-56px); }
.fb-step.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
/* margin:auto centra verticalmente y permite scroll si el paso
   es más alto que el viewport (móvil con teclado abierto) */
.fb-inner {
  margin: auto;
  width: 100%;
  max-width: 680px;
}

/* ── Tipografía de pregunta ── */
.fb-kicker {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 18px;
}
.fb-qnum {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}
.fb-step h1,
.fb-step h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.fb-step h1 em,
.fb-step h2 em { font-style: italic; color: var(--accent); }
.fb-sub {
  margin-top: 14px;
  max-width: 540px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-dim);
}

/* ── Opciones (selector de formación) ── */
.fb-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 32px;
  max-width: 480px;
}
.fb-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.fb-option:hover {
  border-color: var(--line-strong);
  transform: translateX(4px);
}
.fb-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.fb-key {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-dim);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  transition: all 0.2s ease;
}
.fb-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(37, 128, 227, 0.08);
  box-shadow: 0 0 24px rgba(37, 128, 227, 0.12);
}
.fb-option:has(input:checked) .fb-key {
  background: var(--accent);
  border-color: var(--accent);
  color: #051018;
}
.fb-option:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Estrellas 1–5 ── */
.fb-stars {
  display: flex;
  gap: 6px;
  margin-top: 36px;
}
.fb-star {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px;
  cursor: pointer;
  border-radius: 10px;
}
.fb-star input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.fb-star svg {
  width: 52px;
  height: 52px;
  display: block;
}
.fb-star svg path {
  fill: transparent;
  stroke: var(--ink-mute);
  stroke-width: 1.4;
  stroke-linejoin: round;
  transition: fill 0.18s ease, stroke 0.18s ease;
}
.fb-star-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  transition: color 0.18s ease;
}
.fb-star:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Relleno acumulado: seleccionar la estrella N pinta de la 1 a la N */
.fb-stars:has(.fb-star:nth-child(1) input:checked) .fb-star:nth-child(-n+1) svg path,
.fb-stars:has(.fb-star:nth-child(2) input:checked) .fb-star:nth-child(-n+2) svg path,
.fb-stars:has(.fb-star:nth-child(3) input:checked) .fb-star:nth-child(-n+3) svg path,
.fb-stars:has(.fb-star:nth-child(4) input:checked) .fb-star:nth-child(-n+4) svg path,
.fb-stars:has(.fb-star:nth-child(5) input:checked) .fb-star:nth-child(-n+5) svg path {
  fill: var(--accent);
  stroke: var(--accent);
}
.fb-stars:has(.fb-star:nth-child(1) input:checked) .fb-star:nth-child(-n+1) .fb-star-num,
.fb-stars:has(.fb-star:nth-child(2) input:checked) .fb-star:nth-child(-n+2) .fb-star-num,
.fb-stars:has(.fb-star:nth-child(3) input:checked) .fb-star:nth-child(-n+3) .fb-star-num,
.fb-stars:has(.fb-star:nth-child(4) input:checked) .fb-star:nth-child(-n+4) .fb-star-num,
.fb-stars:has(.fb-star:nth-child(5) input:checked) .fb-star:nth-child(-n+5) .fb-star-num {
  color: var(--accent);
}

/* Previsualización al pasar el ratón (solo punteros finos) */
@media (hover: hover) and (pointer: fine) {
  .fb-stars:has(.fb-star:nth-child(1):hover) .fb-star:nth-child(-n+1) svg path,
  .fb-stars:has(.fb-star:nth-child(2):hover) .fb-star:nth-child(-n+2) svg path,
  .fb-stars:has(.fb-star:nth-child(3):hover) .fb-star:nth-child(-n+3) svg path,
  .fb-stars:has(.fb-star:nth-child(4):hover) .fb-star:nth-child(-n+4) svg path,
  .fb-stars:has(.fb-star:nth-child(5):hover) .fb-star:nth-child(-n+5) svg path {
    fill: var(--accent);
    stroke: var(--accent);
    fill-opacity: 0.75;
  }
}

/* ── Campos de texto ── */
.fb-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
  max-width: 560px;
}
.fb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fb-field.full { grid-column: 1 / -1; }
.fb-field label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fb-field label .opt {
  color: var(--ink-mute);
  text-transform: none;
  letter-spacing: 0;
}
.fb-field input,
.fb-field textarea {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.fb-field input::placeholder,
.fb-field textarea::placeholder { color: var(--ink-mute); }
.fb-field input:hover,
.fb-field textarea:hover { border-color: var(--line-strong); }
.fb-field input:focus,
.fb-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 128, 227, 0.18);
  background: var(--bg-card);
}
.fb-field textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.55;
}
.fb-textarea-wrap {
  margin-top: 32px;
  max-width: 560px;
}
.fb-micro {
  margin-top: 14px;
  max-width: 560px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-mute);
}
.fb-micro a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 0.2s ease;
}
.fb-micro a:hover { border-color: var(--accent); }

/* ── Consentimiento de testimonio ── */
.fb-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  max-width: 560px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-dim);
  cursor: pointer;
}
.fb-consent input[type="checkbox"] {
  appearance: none;
  width: 18px; height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}
.fb-consent input[type="checkbox"]:hover { border-color: var(--ink-dim); }
.fb-consent input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.fb-consent input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px; left: 5px;
  width: 5px; height: 9px;
  border: solid #051018;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ── Botones y acciones ── */
.fb-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
}
.fb-btn {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--accent);
  color: #051018;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.fb-btn:hover:not(:disabled) {
  box-shadow: 0 0 40px var(--accent-glow);
  transform: translateY(-1px);
}
.fb-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.fb-btn svg { transition: transform 0.2s ease; }
.fb-btn:hover:not(:disabled) svg { transform: translateX(3px); }
.fb-enter-hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}
@media (hover: none) {
  .fb-enter-hint { display: none; }
}

/* ── Errores y estado de envío ── */
.fb-error {
  display: none;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--accent-warm);
  max-width: 560px;
}
.fb-step.has-error .fb-error { display: block; }
@keyframes fbShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.fb-step.has-error .fb-inner { animation: fbShake 0.3s ease; }

.fb-status {
  display: none;
  margin-top: 20px;
  max-width: 560px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  padding: 14px 16px;
  border-radius: 8px;
}
.fb-status.is-error {
  display: block;
  color: var(--accent-warm);
  background: rgba(255, 184, 107, 0.08);
  border: 1px solid rgba(255, 184, 107, 0.3);
}

/* ── Pantalla final ── */
.fb-ok {
  width: 56px; height: 56px;
  margin-bottom: 24px;
  border-radius: 50%;
  background: rgba(37, 128, 227, 0.12);
  border: 1px solid var(--accent);
  display: grid;
  place-items: center;
  box-shadow: 0 0 32px var(--accent-glow);
}
.fb-ok::after {
  content: '';
  width: 14px; height: 22px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-2px, -2px);
}
.fb-back {
  display: inline-block;
  margin-top: 28px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color 0.2s ease;
}
.fb-back:hover { border-color: var(--accent); }

/* ── Pie: hint de teclado + flechas de navegación ── */
.fb-foot {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px 20px;
}
.fb-hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}
@media (hover: none) {
  .fb-hint { visibility: hidden; }
}
.fb-arrows { display: flex; gap: 8px; }
.fb-arrow {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-dim);
  cursor: pointer;
  transition: all 0.2s ease;
}
.fb-arrow:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.fb-arrow:disabled { opacity: 0.35; cursor: default; }

.fb-body.is-done .fb-foot,
.fb-body.is-done .fb-count { visibility: hidden; }

/* ── Honeypot — invisible para humanos, visible para bots ── */
.fb-hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
  opacity: 0;
}

/* ── Móvil ── */
@media (max-width: 640px) {
  .fb-top { padding: 16px 18px 8px; }
  .fb-step { padding: 24px 18px; }
  .fb-foot { padding: 10px 18px 16px; }
  .fb-fields { grid-template-columns: 1fr; }
  .fb-star svg { width: 42px; height: 42px; }
  .fb-star { padding: 5px; }
  .fb-actions { flex-wrap: wrap; }
  .fb-btn { width: 100%; justify-content: center; }
  .fb-logo span { display: none; }
}
