:root {
  --rh-bg: #f6f7f9;
  --rh-surface: #ffffff;
  --rh-ink: #1c2430;
  --rh-muted: #6b7785;
  --rh-line: #e6e9ee;
  --rh-primary: #111827;
  --rh-accent: #2563eb;
  --rh-accent-soft: #eef3ff;
  --rh-radius: 16px;
  --rh-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--rh-bg);
  color: var(--rh-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.rh-container { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.rh-main { padding-top: 18px; padding-bottom: 64px; }

/* ---------- Topbar + progreso ---------- */
.rh-topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rh-line);
}
.rh-topbar__inner { display: flex; align-items: center; gap: 14px; height: 56px; }
.rh-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .3px; }
.rh-brand__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rh-accent); }
.rh-brand__name { font-size: 14px; }
.rh-progress-wrap { flex: 1; display: flex; align-items: center; gap: 8px; }
.rh-progress { flex: 1; height: 8px; background: #eceef2; border-radius: 999px; overflow: hidden; }
.rh-progress__bar { height: 100%; background: var(--rh-accent); border-radius: 999px; transition: width .35s ease; }
.rh-progress__label { font-size: 12px; color: var(--rh-muted); min-width: 34px; text-align: right; }
.rh-admin-btn { border-radius: 10px; }

/* ---------- Card base ---------- */
.rh-card {
  background: var(--rh-surface);
  border: 1px solid var(--rh-line);
  border-radius: var(--rh-radius);
  box-shadow: var(--rh-shadow);
  padding: 22px;
}

/* ---------- Intro ---------- */
.rh-intro { display: flex; min-height: 70vh; align-items: center; }
.rh-intro__card { width: 100%; }
.rh-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--rh-accent);
  background: var(--rh-accent-soft); padding: 5px 12px; border-radius: 999px;
}
.rh-intro__title { font-size: 26px; font-weight: 800; margin: 14px 0 8px; line-height: 1.2; }
.rh-intro__lead { color: var(--rh-muted); font-size: 15px; margin-bottom: 20px; }
.rh-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rh-field { display: flex; flex-direction: column; gap: 6px; }
.rh-field:first-child, .rh-field:nth-child(2) { grid-column: 1 / -1; }
.rh-field label { font-size: 13px; font-weight: 600; }
.rh-req { color: #dc2626; }
.rh-field .form-control { border-radius: 10px; border-color: var(--rh-line); padding: 10px 12px; }
.rh-field .form-control:focus { border-color: var(--rh-accent); box-shadow: 0 0 0 3px var(--rh-accent-soft); }
.rh-error { color: #dc2626; font-size: 12px; }
.rh-intro__nota { font-size: 13px; color: var(--rh-muted); margin: 18px 0; }

/* ---------- Botones ---------- */
.rh-btn-primary {
  background: var(--rh-primary); color: #fff; border: none;
  border-radius: 12px; padding: 12px 18px; font-weight: 600;
  transition: transform .08s ease, opacity .2s ease;
}
.rh-btn-primary:hover { color:#fff; opacity: .92; }
.rh-btn-primary:active { transform: translateY(1px); }
.rh-btn-primary:disabled { opacity: .5; }
.rh-btn-ghost {
  background: transparent; color: var(--rh-ink);
  border: 1px solid var(--rh-line); border-radius: 12px; padding: 11px 16px; font-weight: 600;
}
.rh-btn-ghost:hover { background: #f1f3f7; }
.rh-btn-ghost:disabled { opacity: .4; }

/* ---------- Stepper ---------- */
.rh-steps {
  display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 14px;
  scrollbar-width: none;
}
.rh-steps::-webkit-scrollbar { display: none; }
.rh-step { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; opacity: .55; }
.rh-step.is-active, .rh-step.is-done { opacity: 1; }
.rh-step__num {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: #e9edf3; color: var(--rh-muted);
}
.rh-step.is-active .rh-step__num { background: var(--rh-accent); color: #fff; }
.rh-step.is-done .rh-step__num { background: #16a34a; color: #fff; }
.rh-step__label { font-size: 12px; font-weight: 600; white-space: nowrap; }

/* ---------- Sección ---------- */
.rh-section__head { margin-bottom: 8px; }
.rh-section__eyebrow { font-size: 12px; color: var(--rh-accent); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.rh-section__title { font-size: 21px; font-weight: 800; margin: 4px 0 2px; }
.rh-section__sub { color: var(--rh-muted); font-size: 14px; margin: 0; }

.rh-reactivo { padding: 18px 0; border-top: 1px solid var(--rh-line); }
.rh-reactivo.is-error .rh-reactivo__text { color: #dc2626; }
.rh-reactivo.is-error .rh-option { border-color: #f3c0c0; }
.rh-reactivo__q { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.rh-reactivo__num {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px;
  background: var(--rh-accent-soft); color: var(--rh-accent);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.rh-reactivo__text { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.45; }

/* Opciones */
.rh-options { display: flex; flex-direction: column; gap: 8px; }
.rh-option {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  border: 1px solid var(--rh-line); border-radius: 12px; padding: 12px 14px;
  transition: border-color .15s ease, background .15s ease;
}
.rh-option:hover { border-color: #c9d3e3; background: #fafbfd; }
.rh-option.is-checked { border-color: var(--rh-accent); background: var(--rh-accent-soft); }
.rh-option input { display: none; }
.rh-option__key {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid #cdd5e1; display: grid; place-items: center;
  font-weight: 700; font-size: 12px; color: var(--rh-muted);
}
.rh-option.is-checked .rh-option__key { background: var(--rh-accent); color: #fff; border-color: var(--rh-accent); }
.rh-option__text { font-size: 14px; }

/* Abierta */
.rh-open .form-control { border-radius: 12px; border-color: var(--rh-line); }
.rh-open .form-control:focus { border-color: var(--rh-accent); box-shadow: 0 0 0 3px var(--rh-accent-soft); }
.rh-open__hint { display: block; margin-top: 6px; color: var(--rh-muted); font-size: 12px; }

/* Navegación */
.rh-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rh-line); }
.rh-save-state { font-size: 12px; color: var(--rh-muted); }

/* ---------- Resultado ---------- */
.rh-result__head { text-align: center; margin-bottom: 18px; }
.rh-result__icon { font-size: 44px; color: #16a34a; }
.rh-result__head h2 { font-weight: 800; margin: 8px 0 4px; }
.rh-score { display: flex; align-items: center; gap: 20px; padding: 18px 0; border-top: 1px solid var(--rh-line); border-bottom: 1px solid var(--rh-line); }
.rh-score__ring { width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
.rh-score__inner { width: 84px; height: 84px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; }
.rh-score__inner strong { font-size: 26px; line-height: 1; }
.rh-score__inner span { font-size: 12px; color: var(--rh-muted); }
.rh-score__meta { flex: 1; }
.rh-score__pct { color: var(--rh-muted); font-size: 14px; margin: 8px 0 4px; }
.rh-score__decision { font-size: 14px; margin: 0; }
.rh-badge { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.rh-badge--ok { background: #dcfce7; color: #166534; }
.rh-badge--info { background: #e0f2fe; color: #075985; }
.rh-badge--warn { background: #fef3c7; color: #92400e; }
.rh-badge--bad { background: #fee2e2; color: #991b1b; }

.rh-alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; margin-top: 18px; font-size: 14px; }
.rh-alert i { font-size: 20px; }
.rh-alert ul { margin: 4px 0 0; padding-left: 18px; }
.rh-alert--warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.rh-alert--info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.rh-report { margin-top: 20px; }
.rh-report h3 { font-size: 17px; font-weight: 800; }
.rh-report__text { color: var(--rh-ink); font-size: 14px; line-height: 1.6; white-space: pre-line; }
.rh-report__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 12px; }
.rh-report__cols h4 { font-size: 14px; font-weight: 700; }
.rh-report__cols ul { padding-left: 18px; font-size: 14px; }
.rh-result__actions { margin-top: 22px; text-align: center; }

/* ---------- Modal admin ---------- */
.rh-modal { position: fixed; inset: 0; background: rgba(17,24,39,.5); display: grid; place-items: center; z-index: 50; padding: 16px; }
.rh-modal__box { background: #fff; border-radius: 16px; width: 100%; max-width: 640px; max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; }
.rh-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--rh-line); }
.rh-modal__head h3 { font-size: 16px; font-weight: 800; margin: 0; }
.rh-modal__body { padding: 18px 20px; overflow: auto; }
.rh-modal__body h5 { font-size: 13px; font-weight: 700; margin-top: 16px; text-transform: uppercase; letter-spacing: .4px; color: var(--rh-muted); }
.rh-pre { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 10px; font-size: 12px; white-space: pre-wrap; word-break: break-word; }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .rh-datos { grid-template-columns: 1fr; }
  .rh-report__cols { grid-template-columns: 1fr; }
  .rh-intro__title { font-size: 22px; }
  .rh-step__label { display: none; }
  .rh-step { gap: 0; }
  .rh-card { padding: 18px 16px; }
  .rh-score { flex-direction: column; text-align: center; }
}
