/* ============================================================================
   Renew4U · Registros — registros.css (F4F)
   Sistema visual heredado del prototipo aprobado (y del plugin Check-in). Todo
   prefijado r4u- y encapsulado en .r4u-registros para no chocar con estilos
   globales de WordPress/Elementor. Cada shortcode renderiza un módulo propio.
   ========================================================================== */

.r4u-registros {
  --r4u-blue: #1e63d5;
  --r4u-blue-hover: #1a56ba;
  --r4u-blue-tint: #eef4fd;
  --r4u-navy: #103c4e;
  --r4u-green: #8cc63e;
  --r4u-green-tint: #f1f9ec;
  --r4u-surface: #f7f8fa;
  --r4u-white: #ffffff;
  --r4u-border: #dce5ed;
  --r4u-border-strong: #c4d1de;
  --r4u-text: #182536;
  --r4u-muted: #647386;

  --r4u-ready-bg: #f1f9ec;
  --r4u-ready-border: #cfe7b6;
  --r4u-ready-accent: #6fae2f;
  --r4u-challenge-bg: #fff8ea;
  --r4u-challenge-border: #f2e0b0;
  --r4u-challenge-accent: #d99a12;
  --r4u-support-bg: #fdf1f0;
  --r4u-support-border: #f3ccc7;
  --r4u-support-accent: #d1635a;

  --r4u-radius-sm: 10px;
  --r4u-radius-md: 16px;
  --r4u-radius-lg: 24px;

  --r4u-space-1: 4px;  --r4u-space-2: 8px;  --r4u-space-3: 12px;
  --r4u-space-4: 16px; --r4u-space-5: 24px; --r4u-space-6: 32px;
  --r4u-space-7: 48px; --r4u-space-8: 64px;

  --r4u-shadow-sm: 0 1px 2px rgba(16, 60, 78, 0.04);
  --r4u-shadow-md: 0 4px 16px rgba(16, 60, 78, 0.06);
  --r4u-shadow-focus: 0 0 0 3px rgba(30, 99, 213, 0.22);

  --r4u-font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  box-sizing: border-box;
  font-family: var(--r4u-font);
  color: var(--r4u-text);
  background: var(--r4u-surface);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding: var(--r4u-space-5) var(--r4u-space-4) var(--r4u-space-8);
}
.r4u-registros *, .r4u-registros *::before, .r4u-registros *::after { box-sizing: border-box; }

.r4u-visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ============================= ENCABEZADO ================================= */
.r4u-header { max-width: 760px; margin: 0 auto var(--r4u-space-5); text-align: center; }
.r4u-header__brand { display: flex; flex-direction: column; align-items: center; gap: var(--r4u-space-2); }
.r4u-logo__word { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; color: var(--r4u-navy); }
.r4u-logo__accent { color: var(--r4u-blue); }
.r4u-tagline {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--r4u-muted);
}

/* ============================= STEPPER =================================== */
.r4u-stepper { max-width: 720px; margin: var(--r4u-space-5) auto var(--r4u-space-6); }
.r4u-stepper__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
.r4u-stepper__item { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--r4u-space-2); text-align: center; }
.r4u-stepper__item::before {
  content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px;
  background: var(--r4u-border); z-index: 0;
}
.r4u-stepper__item:first-child::before { display: none; }
.r4u-stepper__item.is-complete::before { background: var(--r4u-blue); }
.r4u-stepper__dot {
  position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%;
  background: var(--r4u-white); border: 2px solid var(--r4u-border-strong);
  display: grid; place-items: center; color: var(--r4u-muted); font-weight: 700; font-size: 0.85rem;
  transition: background .25s ease, border-color .25s ease, color .25s ease;
}
.r4u-stepper__label { font-size: 0.72rem; font-weight: 600; color: var(--r4u-muted); max-width: 11ch; transition: color .25s ease; }
.r4u-stepper__item.is-active .r4u-stepper__dot, .r4u-stepper__item.is-complete .r4u-stepper__dot {
  background: var(--r4u-blue); border-color: var(--r4u-blue); color: var(--r4u-white);
}
.r4u-stepper__item.is-active .r4u-stepper__label, .r4u-stepper__item.is-complete .r4u-stepper__label { color: var(--r4u-navy); }
.r4u-stepper__item.is-complete .r4u-stepper__num { display: none; }
.r4u-stepper__item.is-complete .r4u-stepper__dot::after {
  content: ""; width: 11px; height: 6px; border-left: 2px solid var(--r4u-white);
  border-bottom: 2px solid var(--r4u-white); transform: rotate(-45deg) translate(0, -1px); margin-top: -2px;
}

/* ============================= MAIN / STEPS ============================== */
.r4u-main { max-width: 760px; margin: 0 auto; }
.r4u-step { outline: none; }
.r4u-step[hidden] { display: none; }
.r4u-step.is-active { animation: r4u-fade .28s ease both; }
@keyframes r4u-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.r4u-step__intro { text-align: center; margin-bottom: var(--r4u-space-6); }
.r4u-step__title { font-size: 1.5rem; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; color: var(--r4u-navy); margin: 0 0 var(--r4u-space-3); text-wrap: balance; }
.r4u-step__desc { font-size: 1rem; color: var(--r4u-muted); margin: 0 auto; max-width: 54ch; }
.r4u-step__desc strong { color: var(--r4u-blue); font-weight: 600; }

/* ============================= CARD ===================================== */
.r4u-card {
  background: var(--r4u-white); border: 1px solid var(--r4u-border);
  border-radius: var(--r4u-radius-lg); padding: var(--r4u-space-6);
  box-shadow: var(--r4u-shadow-sm); margin-bottom: var(--r4u-space-5);
}
.r4u-card__head { margin-bottom: var(--r4u-space-5); }
.r4u-card__title {
  font-size: 1.1rem; font-weight: 700; color: var(--r4u-navy); margin: 0;
  display: flex; align-items: center; gap: var(--r4u-space-3); flex-wrap: wrap;
}
.r4u-card__sub { font-size: 0.9rem; color: var(--r4u-muted); margin: var(--r4u-space-2) 0 0; }
.r4u-badge {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: var(--r4u-surface);
  color: var(--r4u-muted); border: 1px solid var(--r4u-border);
}
.r4u-badge--opt { background: var(--r4u-green-tint); border-color: var(--r4u-ready-border); color: var(--r4u-ready-accent); }

.r4u-note {
  display: flex; gap: var(--r4u-space-3); padding: var(--r4u-space-4);
  background: var(--r4u-surface); border: 1px solid var(--r4u-border);
  border-radius: var(--r4u-radius-md); margin-bottom: var(--r4u-space-5);
}
.r4u-note--brand { background: var(--r4u-blue-tint); border-color: #cfe0fb; }
.r4u-note__icon { flex: none; color: var(--r4u-blue); }
.r4u-note__icon svg { width: 20px; height: 20px; }
.r4u-note p { margin: 0; font-size: 0.88rem; color: var(--r4u-text); }
.r4u-note p strong { color: var(--r4u-navy); }

/* ============================= FIELDS =================================== */
.r4u-field { margin-bottom: var(--r4u-space-5); }
.r4u-field:last-child { margin-bottom: 0; }
.r4u-label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--r4u-navy); margin-bottom: var(--r4u-space-2); }
.r4u-req { color: var(--r4u-blue); }
.r4u-opt-tag { font-size: 0.75rem; font-weight: 500; color: var(--r4u-muted); }

.r4u-input, .r4u-select, .r4u-textarea {
  width: 100%; font-family: inherit; font-size: 0.98rem; color: var(--r4u-text);
  background: var(--r4u-white); border: 1px solid var(--r4u-border-strong);
  border-radius: var(--r4u-radius-sm); padding: 13px 14px;
  transition: border-color .2s ease, box-shadow .2s ease; -webkit-appearance: none; appearance: none;
}
.r4u-textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
.r4u-input::placeholder, .r4u-textarea::placeholder { color: #9aa7b6; }
.r4u-input:focus, .r4u-select:focus, .r4u-textarea:focus {
  outline: none; border-color: var(--r4u-blue); box-shadow: var(--r4u-shadow-focus);
}
.r4u-input.is-invalid, .r4u-select.is-invalid, .r4u-textarea.is-invalid {
  border-color: var(--r4u-support-accent); box-shadow: 0 0 0 3px rgba(209, 99, 90, 0.16);
}
.r4u-select-wrap { position: relative; }
.r4u-select { padding-right: 42px; cursor: pointer; }
.r4u-select-caret { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--r4u-muted); pointer-events: none; }

.r4u-help { font-size: 0.82rem; color: var(--r4u-muted); margin: var(--r4u-space-2) 0 0; }
.r4u-error {
  font-size: 0.85rem; font-weight: 500; color: var(--r4u-support-accent);
  margin: var(--r4u-space-2) 0 0; display: flex; align-items: center; gap: 6px;
}
.r4u-error[hidden] { display: none; }
.r4u-error::before {
  content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--r4u-support-accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M12 2a10 10 0 100 20 10 10 0 000-20zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M12 2a10 10 0 100 20 10 10 0 000-20zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E") center/contain no-repeat;
}
/* Banner de error a nivel de formulario (403/413/415/429/red) */
.r4u-formerror {
  margin: 0 0 var(--r4u-space-4); padding: var(--r4u-space-3) var(--r4u-space-4);
  background: var(--r4u-support-bg); border: 1px solid var(--r4u-support-border);
  border-radius: var(--r4u-radius-md);
}
.r4u-formerror[hidden] { display: none; }
.r4u-formerror::before { display: none; }

/* Grid para pares de campos (medidas, altura/peso) */
.r4u-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--r4u-space-4); }
.r4u-measure-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--r4u-space-4); }
.r4u-input-unit { position: relative; }
.r4u-input-unit .r4u-input { padding-right: 46px; }
.r4u-input-unit__u { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 0.85rem; font-weight: 600; color: var(--r4u-muted); pointer-events: none; }

/* Escala 1–5 / 1–10 reutilizable */
.r4u-rating__options { display: flex; gap: var(--r4u-space-2); justify-content: flex-end; flex-wrap: wrap; }
.r4u-rating__opt { position: relative; }
.r4u-rating__opt input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; top: 0; left: 0; }
.r4u-rating__opt label {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--r4u-border-strong); background: var(--r4u-white); color: var(--r4u-muted);
  font-weight: 700; font-size: 0.95rem; cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.r4u-rating__opt input:hover + label { border-color: var(--r4u-blue); color: var(--r4u-blue); }
.r4u-rating__opt input:checked + label { background: var(--r4u-blue); border-color: var(--r4u-blue); color: var(--r4u-white); transform: translateY(-1px); }
.r4u-rating__opt input:focus-visible + label { outline: none; box-shadow: var(--r4u-shadow-focus); }

/* Opción tipo tarjeta (radios sí/no, elección visible) */
.r4u-choices { display: grid; gap: var(--r4u-space-3); }
.r4u-choices--row { grid-template-columns: 1fr 1fr; }
.r4u-choice {
  position: relative; display: flex; gap: var(--r4u-space-3); padding: var(--r4u-space-4);
  border: 1.5px solid var(--r4u-border); border-radius: var(--r4u-radius-md);
  background: var(--r4u-white); cursor: pointer;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.r4u-choice__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.r4u-choice__mark { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--r4u-border-strong); margin-top: 2px; display: grid; place-items: center; transition: border-color .2s ease; }
.r4u-choice__mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: transparent; transition: background .2s ease; }
.r4u-choice__title { display: block; font-size: 0.92rem; font-weight: 700; color: var(--r4u-navy); }
.r4u-choice__desc { display: block; font-size: 0.82rem; color: var(--r4u-muted); line-height: 1.45; margin-top: 3px; }
.r4u-choice:hover { border-color: var(--r4u-border-strong); }
.r4u-choice.is-selected { background: var(--r4u-blue-tint); border-color: #bcd4f7; }
.r4u-choice.is-selected .r4u-choice__mark { border-color: var(--r4u-blue); }
.r4u-choice.is-selected .r4u-choice__mark::after { background: var(--r4u-blue); }
.r4u-choice__input:focus-visible + .r4u-choice__mark { box-shadow: var(--r4u-shadow-focus); }

/* Checkboxes tipo píldora */
.r4u-checks { display: flex; flex-wrap: wrap; gap: var(--r4u-space-2); }
.r4u-check { position: relative; }
.r4u-check input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.r4u-check label {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--r4u-border-strong); background: var(--r4u-white); color: var(--r4u-text);
  font-size: 0.88rem; font-weight: 500; cursor: pointer; transition: all .16s ease;
}
.r4u-check input:checked + label { background: var(--r4u-blue-tint); border-color: var(--r4u-blue); color: var(--r4u-blue); font-weight: 600; }
.r4u-check input:focus-visible + label { outline: none; box-shadow: var(--r4u-shadow-focus); }

/* Consentimiento (capa de salud) */
.r4u-consent {
  border: 1.5px solid var(--r4u-border); border-radius: var(--r4u-radius-md);
  padding: var(--r4u-space-5); background: var(--r4u-surface);
}
.r4u-consent__title { font-size: 0.95rem; font-weight: 700; color: var(--r4u-navy); margin: 0 0 var(--r4u-space-2); }
.r4u-consent__text { font-size: 0.86rem; color: var(--r4u-muted); margin: 0 0 var(--r4u-space-4); }

/* Sección condicional / opcional colapsable */
.r4u-reveal[hidden] { display: none; }
.r4u-reveal { margin-top: var(--r4u-space-5); padding-top: var(--r4u-space-5); border-top: 1px dashed var(--r4u-border); }

/* ============================= DROP ZONE =============================== */
.r4u-upload {
  border: 2px dashed var(--r4u-border-strong); border-radius: var(--r4u-radius-md);
  background: var(--r4u-surface); padding: var(--r4u-space-6) var(--r4u-space-5);
  text-align: center; cursor: pointer; transition: border-color .2s ease, background .2s ease;
}
.r4u-upload:hover, .r4u-upload.is-dragover { border-color: var(--r4u-blue); background: var(--r4u-blue-tint); }
.r4u-upload:focus-visible { outline: none; box-shadow: var(--r4u-shadow-focus); }
.r4u-upload__icon { width: 52px; height: 52px; border-radius: 16px; background: var(--r4u-blue-tint); color: var(--r4u-blue); display: grid; place-items: center; margin: 0 auto var(--r4u-space-3); }
.r4u-upload__icon svg { width: 26px; height: 26px; }
.r4u-upload__title { font-size: 0.98rem; font-weight: 600; color: var(--r4u-navy); margin: 0 0 4px; }
.r4u-upload__title .r4u-upload__link { color: var(--r4u-blue); text-decoration: underline; }
.r4u-upload__hint { font-size: 0.8rem; color: var(--r4u-muted); margin: 0; }
.r4u-upload__input { display: none; }
.r4u-preview-list { display: flex; flex-direction: column; gap: var(--r4u-space-3); margin-bottom: var(--r4u-space-3); }
.r4u-preview { display: flex; align-items: center; gap: var(--r4u-space-4); padding: var(--r4u-space-4); border: 1px solid var(--r4u-border); border-radius: var(--r4u-radius-md); background: var(--r4u-white); }
.r4u-preview__thumb { flex: none; width: 60px; height: 60px; border-radius: 12px; object-fit: cover; border: 1px solid var(--r4u-border); background: var(--r4u-surface); }
.r4u-preview__thumb--file { display: grid; place-items: center; background: var(--r4u-blue-tint); color: var(--r4u-blue); font-size: 0.7rem; font-weight: 700; }
.r4u-preview__meta { flex: 1; min-width: 0; }
.r4u-preview__name { font-size: 0.9rem; font-weight: 600; color: var(--r4u-navy); margin: 0 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r4u-preview__size { font-size: 0.8rem; color: var(--r4u-muted); margin: 0; }
.r4u-preview__actions { display: flex; gap: var(--r4u-space-2); flex: none; }
.r4u-preview__btn { font-family: inherit; font-size: 0.82rem; font-weight: 600; color: var(--r4u-muted); background: var(--r4u-surface); border: 1px solid var(--r4u-border); border-radius: 8px; padding: 7px 12px; cursor: pointer; transition: color .18s ease, border-color .18s ease; }
.r4u-preview__btn:hover { color: var(--r4u-support-accent); border-color: var(--r4u-support-border); }
.r4u-preview__btn:focus-visible { outline: none; box-shadow: var(--r4u-shadow-focus); }

/* ============================= BOTONES ================================= */
.r4u-actions { display: flex; gap: var(--r4u-space-3); margin-top: var(--r4u-space-2); }
.r4u-actions--end { justify-content: flex-end; }
.r4u-actions--split { justify-content: space-between; }
.r4u-btn {
  font-family: inherit; font-size: 0.98rem; font-weight: 600; border-radius: var(--r4u-radius-sm);
  padding: 14px 28px; cursor: pointer; border: 1.5px solid transparent;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .1s ease;
}
.r4u-btn:active { transform: translateY(1px); }
.r4u-btn[disabled] { opacity: .6; cursor: default; }
.r4u-btn--primary { background: var(--r4u-blue); color: var(--r4u-white); }
.r4u-btn--primary:hover { background: var(--r4u-blue-hover); }
.r4u-btn--ghost { background: var(--r4u-white); color: var(--r4u-navy); border-color: var(--r4u-border-strong); }
.r4u-btn--ghost:hover { border-color: var(--r4u-navy); }
.r4u-btn:focus-visible { outline: none; box-shadow: var(--r4u-shadow-focus); }

/* ============================= CONFIRMACIÓN ============================ */
.r4u-confirm__inner { background: var(--r4u-white); border: 1px solid var(--r4u-border); border-radius: var(--r4u-radius-lg); padding: var(--r4u-space-8) var(--r4u-space-6); text-align: center; box-shadow: var(--r4u-shadow-md); }
.r4u-confirm__icon { width: 64px; height: 64px; border-radius: 50%; background: var(--r4u-ready-bg); color: var(--r4u-ready-accent); display: grid; place-items: center; margin: 0 auto var(--r4u-space-5); }
.r4u-confirm__icon svg { width: 32px; height: 32px; }
.r4u-confirm__title { font-size: 1.5rem; font-weight: 700; color: var(--r4u-navy); margin: 0 0 var(--r4u-space-3); text-wrap: balance; }
.r4u-confirm__msg { font-size: 1rem; color: var(--r4u-text); margin: 0 auto var(--r4u-space-2); max-width: 46ch; }
.r4u-confirm__msg--muted { color: var(--r4u-muted); font-size: 0.92rem; margin-bottom: var(--r4u-space-6); }

/* ============================= FOOTER ================================= */
.r4u-footer { max-width: 760px; margin: var(--r4u-space-8) auto 0; padding-top: var(--r4u-space-5); border-top: 1px solid var(--r4u-border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--r4u-space-3); }
.r4u-footer__tag { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--r4u-muted); }
.r4u-footer__brand { font-weight: 700; color: var(--r4u-navy); }

/* ============================= RESPONSIVE ============================== */
@media (max-width: 640px) {
  .r4u-registros { padding: var(--r4u-space-4) var(--r4u-space-3) var(--r4u-space-7); }
  .r4u-step__title { font-size: 1.3rem; }
  .r4u-card { padding: var(--r4u-space-5); }
  .r4u-grid-2 { grid-template-columns: 1fr; }
  .r4u-choices--row { grid-template-columns: 1fr; }
  .r4u-stepper__label { font-size: 0.62rem; }
  .r4u-rating__options { justify-content: space-between; gap: 6px; }
  .r4u-rating__opt { flex: 1; }
  .r4u-rating__opt label { width: 100%; height: 46px; }
  .r4u-actions--split { flex-direction: column-reverse; }
  .r4u-actions--split .r4u-btn, .r4u-actions--end .r4u-btn { width: 100%; }
  .r4u-preview { flex-wrap: wrap; }
  .r4u-preview__actions { width: 100%; }
  .r4u-preview__btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .r4u-registros *, .r4u-registros *::before, .r4u-registros *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important;
  }
}
