/* onboarding.css — estilos específicos del flujo multi-step.
   Hereda variables (--primary, --accent, etc.) y .container / .btn de /landing/style.css.
   Mobile-first; breakpoints alineados con el resto del landing. */

/* ============ LAYOUT GLOBAL ============ */
.onboarding-body {
  background: var(--bg-soft);
  min-height: 100vh;
}

.onb-main {
  padding: 32px 0 64px;
}

@media (min-width: 760px) {
  .onb-main { padding: 48px 0 80px; }
}

/* ============ INTRO ============ */
.onb-intro {
  margin-bottom: 24px;
}
.onb-eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 6px;
}
.onb-title {
  font-size: clamp(26px, 4vw, 36px);
  margin: 0 0 10px;
}
.onb-sub {
  font-size: 15px;
  color: var(--text-soft);
  margin: 0 0 12px;
}
.onb-autosave {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.onb-autosave-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  display: inline-block;
}
.onb-autosave.saving .onb-autosave-dot { background: var(--accent); }

/* ============ PROGRESS BAR ============ */
.onb-progress {
  margin-bottom: 28px;
}
.onb-progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-alt);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.onb-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width 0.3s ease;
}
.onb-progress-label {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-soft);
  text-align: right;
}
.onb-progress-label strong {
  color: var(--text);
  font-weight: 600;
}

/* ============ FORM SHELL ============ */
.onb-form {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
}
@media (min-width: 760px) {
  .onb-form { padding: 36px 36px; }
}

.onb-honeypot {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ============ STEP ============ */
.onb-step[hidden] { display: none; }

.onb-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
.onb-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.onb-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.onb-help {
  color: var(--text-soft);
  font-size: 14px;
  margin: 0 0 20px;
}

/* ============ FIELDS ============ */
.onb-field {
  margin-bottom: 18px;
}
.onb-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.onb-required {
  color: #dc2626;
  font-weight: 700;
}
.onb-optional {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 13px;
}
.onb-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.onb-counter { font-variant-numeric: tabular-nums; }

.onb-field input[type="text"],
.onb-field input[type="email"],
.onb-field input[type="tel"],
.onb-field input[type="url"],
.onb-field select,
.onb-field textarea {
  width: 100%;
  font-family: inherit;
  /* 16px evita zoom forzado en iOS Safari al focus. */
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.onb-field input:focus,
.onb-field select:focus,
.onb-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.onb-field input[aria-invalid="true"],
.onb-field select[aria-invalid="true"],
.onb-field textarea[aria-invalid="true"] {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
.onb-field textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

.onb-field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 600px) {
  .onb-field-row { grid-template-columns: 1fr 1fr; }
  .onb-field-row .onb-field { margin-bottom: 18px; }
}

.onb-field-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}
.onb-field-inline label {
  margin: 0;
  font-weight: 500;
  font-size: 14px;
}
.onb-field-inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin: 0;
}

/* ============ ERROR INLINE ============ */
.onb-field-error {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: #dc2626;
  font-weight: 500;
}

/* ============ UPLOAD ZONE ============ */
.onb-upload-zone {
  position: relative;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  background: var(--bg-soft);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.onb-upload-zone:hover,
.onb-upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.onb-upload-zone-small {
  padding: 18px 16px;
}
.onb-upload-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.onb-upload-prompt {
  pointer-events: none;
}
.onb-upload-prompt p {
  margin: 4px 0;
  font-size: 14px;
  color: var(--text-soft);
}
.onb-upload-prompt p strong {
  color: var(--text);
  font-weight: 600;
}
.onb-upload-icon {
  display: inline-block;
  font-size: 28px;
  margin-bottom: 6px;
}

.onb-upload-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.onb-upload-list:empty { display: none; }
.onb-upload-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--border);
}
.onb-upload-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.onb-upload-item-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: 0;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.onb-upload-item-remove:hover { background: rgba(220, 38, 38, 0.9); }
.onb-upload-item-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  width: 0;
  transition: width 0.2s;
}
.onb-upload-item.uploaded::after {
  content: '✓';
  position: absolute;
  bottom: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ============ COLOR PICKER ============ */
.onb-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.onb-color-picker {
  width: 56px;
  height: 44px;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  flex-shrink: 0;
}
.onb-color-text {
  flex: 1;
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 14px !important;
  text-transform: lowercase;
}

/* ============ CHECKBOX GRID (paso 7 estilo) ============ */
.onb-checkbox-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 600px) {
  .onb-checkbox-grid { grid-template-columns: 1fr 1fr; }
}

.onb-checkbox-card {
  display: block;
  position: relative;
  padding: 14px 16px 14px 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.onb-checkbox-card:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.onb-checkbox-card input[type="checkbox"] {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}
.onb-checkbox-card input[type="checkbox"]:checked ~ .onb-checkbox-title { color: var(--primary); }
.onb-checkbox-card:has(input[type="checkbox"]:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.onb-checkbox-title {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}
.onb-checkbox-desc {
  display: block;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.4;
}

/* ============ PLAN CARD (paso 8) ============ */
.onb-plan-card {
  position: relative;
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  background: linear-gradient(180deg, var(--primary-soft) 0%, var(--bg) 50%);
  margin: 8px 0 22px;
}
.onb-plan-badge {
  position: absolute;
  top: -12px;
  left: 22px;
  background: var(--accent);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.onb-plan-name {
  margin: 4px 0 8px;
  font-size: 18px;
  font-weight: 700;
}
.onb-plan-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}
.onb-plan-amount {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.onb-plan-unit {
  font-size: 14px;
  color: var(--text-soft);
}
.onb-plan-plus {
  margin: 0 4px;
  color: var(--text-muted);
  font-weight: 700;
}
.onb-plan-feats {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.onb-plan-feats li {
  position: relative;
  padding: 6px 0 6px 24px;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.onb-plan-feats li:last-child { border-bottom: 0; }
.onb-plan-feats li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 6px;
  color: #16a34a;
  font-weight: 800;
}

.onb-annual-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.onb-annual-toggle:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.onb-annual-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 1px 0 0 0;
  flex-shrink: 0;
}
.onb-annual-toggle strong { color: var(--text); }

/* ============ CONSENTIMIENTO ============ */
.onb-consent {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
}
.onb-checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  cursor: pointer;
}
.onb-checkbox-line input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 1px 0 0 0;
  flex-shrink: 0;
  cursor: pointer;
}
.onb-checkbox-line a {
  color: var(--primary);
  text-decoration: underline;
}
.onb-checkbox-line a:hover { color: var(--primary-hover); }

/* ============ TURNSTILE ============ */
.onb-turnstile {
  margin-bottom: 12px;
}
.onb-turnstile .cf-turnstile {
  margin: 8px 0;
}

/* ============ NAV (Anterior / Siguiente / Enviar) ============ */
.onb-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.onb-nav .btn { min-width: 140px; }
@media (max-width: 480px) {
  .onb-nav { flex-direction: column-reverse; }
  .onb-nav .btn { width: 100%; min-width: 0; }
}

/* ============ STATUS GLOBAL ============ */
.onb-status {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 14px;
  text-align: center;
}
.onb-status.error { color: #dc2626; font-weight: 500; }
.onb-status.success { color: #16a34a; font-weight: 500; }
.onb-status.info { color: var(--text-soft); }

/* ============ FIX 2026-06-04: hidden attribute en botones nav ============ */
/* HTML5 [hidden] debe ocultar siempre, sin importar display de padre flex. */
[hidden] { display: none !important; }

/* ============ FIX 2026-06-04: thumbnails upload ============ */
/* Sustituye .onb-upload-item img de F4 (no usado). JS F5 usa estructura:
   .onb-upload-item > .onb-upload-thumb + .onb-upload-meta + buttons (remove/retry) */
.onb-upload-item {
  position: relative;
  display: grid;
  grid-template-columns: 96px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px;
  margin-top: 8px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-sm, 8px);
  background: #fff;
  aspect-ratio: auto;
  overflow: visible;
}
.onb-upload-thumb {
  width: 96px;
  height: 96px;
  border-radius: 6px;
  background-color: #f3f4f6;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #16a34a;
  font-weight: 700;
  flex-shrink: 0;
}
.onb-upload-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.onb-upload-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text, #111827);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.onb-upload-status {
  font-size: 12px;
  color: var(--text-soft, #6b7280);
}
.onb-upload-progress {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 2px;
}
.onb-upload-progress-bar {
  height: 100%;
  width: 0;
  background: #2c5282;
  transition: width 0.2s ease;
}
.onb-upload-remove,
.onb-upload-retry {
  border: none;
  background: #f3f4f6;
  color: #6b7280;
  cursor: pointer;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1;
}
.onb-upload-remove { font-weight: 700; }
.onb-upload-remove:hover { background: #fee2e2; color: #b91c1c; }
.onb-upload-retry { font-size: 12px; }
.onb-upload-retry:hover { background: #e5e7eb; color: #111827; }
@media (max-width: 480px) {
  .onb-upload-item { grid-template-columns: 64px 1fr auto; gap: 8px; }
  .onb-upload-thumb { width: 64px; height: 64px; }
}
