/* =========================================================
   REY FILÓSOFO · CREA TU PROPIA LIBRERÍA
   Onboarding · 9 pantallas + intro + loader
   ========================================================= */

.rfl-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 8px 60px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--c-text, #e5e7eb);
  animation: rflFadeIn 240ms ease;
}

@keyframes rflFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Barra de progreso ─────────────────────────────── */
.rfl-progress {
  height: 2px;
  background: rgba(217, 119, 6, 0.15);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 28px;
}
.rfl-progress-bar {
  height: 100%;
  background: var(--accent, #d97706);
  transition: width 300ms ease;
}

/* ─── Estructura de pantalla ────────────────────────── */
.rfl-body { min-height: 380px; }
.rfl-screen { display: flex; flex-direction: column; gap: 14px; }

.rfl-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent, #d97706);
  opacity: 0.85;
}

.rfl-h2 {
  font-size: 1.35rem;
  font-weight: 500;
  margin: 4px 0 6px;
  line-height: 1.3;
  color: var(--c-text, #e5e7eb);
}

.rfl-p {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--c-text, #e5e7eb);
  margin: 0;
}
.rfl-p--muted { color: var(--c-muted, #9ca3af); font-size: 0.85rem; }
.rfl-p strong { color: var(--accent, #d97706); font-weight: 500; }

.rfl-hint {
  font-size: 0.75rem;
  color: var(--c-muted, #9ca3af);
  margin-top: 6px;
}
.rfl-hint--action { text-align: center; margin-top: 12px; }

.rfl-link {
  background: none;
  border: 0;
  color: var(--accent, #d97706);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px;
}

/* ─── Intro ─────────────────────────────────────────── */
.rfl-screen--intro { text-align: center; padding-top: 20px; }
.rfl-intro-mark {
  font-size: 3rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px rgba(217, 119, 6, 0.35));
}

/* ─── Inputs ────────────────────────────────────────── */
.rfl-input {
  width: 100%;
  background: var(--c-bg, #0a0e17);
  border: 1px solid rgba(217, 119, 6, 0.25);
  border-radius: 6px;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--c-text, #e5e7eb);
  box-sizing: border-box;
  transition: border-color 180ms;
}
.rfl-input:focus {
  outline: none;
  border-color: var(--accent, #d97706);
}
.rfl-textarea {
  min-height: 96px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.rfl-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-muted, #9ca3af);
  margin-top: 8px;
}

/* ─── Chips (tema) ──────────────────────────────────── */
.rfl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.rfl-chip {
  background: transparent;
  border: 1px solid rgba(217, 119, 6, 0.3);
  border-radius: 999px;
  color: var(--c-text, #e5e7eb);
  font: inherit;
  font-size: 0.8rem;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 160ms;
}
.rfl-chip:hover {
  border-color: var(--accent, #d97706);
  background: rgba(217, 119, 6, 0.1);
}

/* ─── Cards (opciones con ejemplo) ──────────────────── */
.rfl-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.rfl-card {
  text-align: left;
  background: var(--p-panel, #111622);
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--c-text, #e5e7eb);
  font: inherit;
  cursor: pointer;
  transition: all 180ms;
}
.rfl-card:hover {
  border-color: var(--accent, #d97706);
  background: rgba(217, 119, 6, 0.06);
}
.rfl-card--selected {
  border-color: var(--accent, #d97706);
  background: rgba(217, 119, 6, 0.12);
  box-shadow: 0 0 0 1px var(--accent, #d97706) inset;
}
.rfl-card-title {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 6px;
}
.rfl-card-sub {
  font-size: 0.82rem;
  color: var(--c-muted, #9ca3af);
  line-height: 1.5;
}
.rfl-card-sub--example {
  font-style: italic;
  border-left: 2px solid rgba(217, 119, 6, 0.35);
  padding-left: 10px;
  margin-top: 4px;
}

/* ─── Pills (conocimiento) ──────────────────────────── */
.rfl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.rfl-pill {
  background: transparent;
  border: 1px solid rgba(217, 119, 6, 0.3);
  border-radius: 6px;
  color: var(--c-text, #e5e7eb);
  font: inherit;
  font-size: 0.85rem;
  padding: 10px 18px;
  cursor: pointer;
  transition: all 160ms;
}
.rfl-pill:hover {
  border-color: var(--accent, #d97706);
  background: rgba(217, 119, 6, 0.08);
}
.rfl-pill--selected {
  background: var(--accent, #d97706);
  color: #0a0e17;
  border-color: var(--accent, #d97706);
  font-weight: 500;
}

/* ─── Estilos literarios ────────────────────────────── */
.rfl-styles {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.rfl-style {
  text-align: left;
  background: var(--p-panel, #111622);
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--c-text, #e5e7eb);
  font: inherit;
  cursor: pointer;
  transition: all 180ms;
}
.rfl-style:hover {
  border-color: var(--accent, #d97706);
  background: rgba(217, 119, 6, 0.06);
}
.rfl-style--selected {
  border-color: var(--accent, #d97706);
  background: rgba(217, 119, 6, 0.12);
  box-shadow: 0 0 0 1px var(--accent, #d97706) inset;
}
.rfl-style-label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent, #d97706);
  margin-bottom: 8px;
}
.rfl-style-text {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--c-text, #e5e7eb);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
}

/* ─── Resumen ───────────────────────────────────────── */
.rfl-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--p-panel, #111622);
}
.rfl-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.85rem;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(217, 119, 6, 0.1);
}
.rfl-summary-row:last-child { border-bottom: 0; }
.rfl-summary-key {
  color: var(--c-muted, #9ca3af);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.rfl-summary-val {
  text-align: right;
  color: var(--c-text, #e5e7eb);
  word-break: break-word;
}

/* ─── Botones y acciones ────────────────────────────── */
.rfl-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.rfl-actions--split { justify-content: space-between; }
.rfl-screen--intro .rfl-actions { justify-content: center; }

.rfl-btn {
  font: inherit;
  font-size: 0.9rem;
  padding: 10px 22px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 180ms;
  border: 1px solid transparent;
}
.rfl-btn--primary {
  background: var(--accent, #d97706);
  color: #0a0e17;
  font-weight: 500;
}
.rfl-btn--primary:hover {
  background: #ea8c1c;
  box-shadow: 0 0 16px rgba(217, 119, 6, 0.4);
}
.rfl-btn--ghost {
  background: transparent;
  color: var(--c-text, #e5e7eb);
  border-color: rgba(217, 119, 6, 0.3);
}
.rfl-btn--ghost:hover {
  border-color: var(--accent, #d97706);
  color: var(--accent, #d97706);
}

/* ─── Error ─────────────────────────────────────────── */
.rfl-error {
  color: #f87171;
  font-size: 0.82rem;
  margin-top: 10px;
  padding: 8px 12px;
  border-left: 2px solid #f87171;
  background: rgba(248, 113, 113, 0.08);
  border-radius: 0 4px 4px 0;
}

/* ─── Loader ────────────────────────────────────────── */
.rfl-screen--loader { text-align: center; padding-top: 30px; }
.rfl-loader-mark {
  font-size: 3rem;
  animation: rflFlip 3s infinite ease-in-out;
  margin-bottom: 16px;
}
@keyframes rflFlip {
  0%   { transform: rotate(0deg); }
  45%  { transform: rotate(180deg); }
  55%  { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}
.rfl-loader-actions {
  margin-top: 24px;
  justify-content: center;
}

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 600px) {
  .rfl-wrap { padding: 16px 4px 40px; }
  .rfl-h2 { font-size: 1.2rem; }
  .rfl-actions { flex-direction: column-reverse; }
  .rfl-actions--split .rfl-btn { width: 100%; text-align: center; }
  .rfl-summary-row { flex-direction: column; gap: 2px; }
  .rfl-summary-val { text-align: left; }
}
