/*
 * feedback-wizard.css — Estilos del wizard de feedback de Hogarfax Fase II.
 *
 * Usa las design tokens de design-tokens.css (cargado antes en _base.html).
 * Mobile-first. Z-index 10300 para estar por encima de beta_modal (10200).
 */

/* ── Modal overlay ───────────────────────────────────────────────── */
.fw-modal {
  position: fixed;
  inset: 0;
  z-index: 10300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.fw-modal[hidden] {
  display: none !important;
}

.fw-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

/* ── Dialog card ─────────────────────────────────────────────────── */
.fw-dialog {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  max-height: min(700px, calc(100vh - 40px));
  border-radius: 24px;
  background: #fff;
  border: 1px solid rgba(30, 58, 95, 0.12);
  box-shadow: 0 24px 90px rgba(15, 23, 42, 0.26);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fwModalIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes fwModalIn {
  from { opacity: 0; transform: scale(0.93) translateY(10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* ── Header: progress + close ────────────────────────────────────── */
.fw-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(30, 58, 95, 0.08);
  flex-shrink: 0;
}

.fw-chip {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid rgba(30, 58, 95, 0.12);
  border-radius: 999px;
  padding: 4px 10px;
  flex-shrink: 0;
}

.fw-progress-wrap {
  flex: 1;
  height: 5px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.fw-progress-bar {
  height: 100%;
  background: #1e3a5f;
  border-radius: 999px;
  width: 0%;
  transition: width 320ms ease;
}

.fw-step-counter {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 36px;
  text-align: right;
}

.fw-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 150ms ease, color 150ms ease;
}
.fw-close:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* ── Body: contenido del paso ────────────────────────────────────── */
.fw-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 8px;
  -webkit-overflow-scrolling: touch;
}

/* ── Step container y animaciones ────────────────────────────────── */
.fw-step {
  animation: fwStepIn 220ms ease both;
}
@keyframes fwStepIn {
  from { opacity: 0; transform: translateX(36px); }
  to   { opacity: 1; transform: translateX(0); }
}
.fw-step--back {
  animation: fwStepInBack 220ms ease both;
}
@keyframes fwStepInBack {
  from { opacity: 0; transform: translateX(-36px); }
  to   { opacity: 1; transform: translateX(0); }
}

.fw-step-title {
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px;
  line-height: 1.25;
}
.fw-step-subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 20px;
  line-height: 1.5;
}

/* ── Bloque de pregunta ──────────────────────────────────────────── */
.fw-question {
  margin-bottom: 20px;
}
.fw-question-label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
  display: block;
}

/* ── Opciones (single_select y multi_select) ─────────────────────── */
.fw-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.fw-options--grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.fw-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 13.5px;
  color: #334155;
  line-height: 1.35;
  transition: border-color 130ms ease, background 130ms ease, box-shadow 130ms ease;
  position: relative;
}
.fw-option:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}
.fw-option--selected {
  border-color: #1e3a5f;
  background: rgba(30, 58, 95, 0.05);
  font-weight: 600;
  color: #0f172a;
}
.fw-option--selected::after {
  content: "✓";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #1e3a5f;
  font-weight: 900;
  font-size: 13px;
}
.fw-option-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}
.fw-option-text {
  flex: 1;
}

/* ── Inputs de texto y textarea ──────────────────────────────────── */
.fw-input,
.fw-textarea {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 13.5px;
  color: #0f172a;
  transition: border-color 130ms ease, box-shadow 130ms ease;
  box-sizing: border-box;
}
.fw-input:focus,
.fw-textarea:focus {
  outline: none;
  border-color: #1e3a5f;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}
.fw-textarea {
  min-height: 90px;
  resize: vertical;
}
.fw-input-hint {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 5px;
}

/* ── NPS score (números del 0 al 10) ────────────────────────────── */
.fw-nps {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.fw-nps-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}
.fw-nps-btn:hover { border-color: #94a3b8; background: #f1f5f9; }
.fw-nps-btn--selected {
  border-color: #1e3a5f;
  background: #1e3a5f;
  color: #fff;
}
.fw-nps-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 11px;
  color: #94a3b8;
}

/* ── Footer: navegación ──────────────────────────────────────────── */
.fw-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 24px 20px;
  border-top: 1px solid rgba(30, 58, 95, 0.07);
  flex-shrink: 0;
}

.fw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background 140ms ease, opacity 140ms ease, transform 100ms ease;
}
.fw-btn:active { transform: scale(0.97); }
.fw-btn--primary {
  background: #1e3a5f;
  color: #fff;
  margin-left: auto;
}
.fw-btn--primary:hover { background: #162d4a; }
.fw-btn--primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.fw-btn--ghost {
  background: #f1f5f9;
  color: #475569;
}
.fw-btn--ghost:hover { background: #e2e8f0; }

/* ── Pantalla final de agradecimiento ───────────────────────────── */
.fw-thankyou {
  text-align: center;
  padding: 20px 10px 10px;
  animation: fwStepIn 280ms ease both;
}
.fw-thankyou-icon {
  font-size: 52px;
  margin-bottom: 12px;
  display: block;
}
.fw-thankyou h2 {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 8px;
}
.fw-thankyou p {
  font-size: 14px;
  color: #64748b;
  margin: 0;
  line-height: 1.6;
}

/* ── Responsive mobile ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .fw-body { padding: 18px 16px 8px; }
  .fw-footer { padding: 12px 16px 16px; }
  .fw-options--grid { grid-template-columns: 1fr; }
  .fw-dialog { border-radius: 20px; }
}
