/* enhanced/styles/enhanced-onboarding.css - LOOK & FEEL PROFESIONAL DECLARA */

/* Contenedor principal del onboarding mejorado */
#enhancedOnboardingContainer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  overflow-y: auto;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.7), transparent 55%),
    linear-gradient(180deg, #f5f4ff 0, #ffffff 40%, #ffffff 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1a1a1a;
}

/* Layout central tipo "card" */
.onboarding-flow {
  max-width: 960px;
  margin: 0 auto;
  padding: 56px 24px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Cada paso se comporta como una tarjeta */
.onboarding-step {
  display: none;
  background: #ffffff;
  border-radius: 24px;
  padding: 32px 32px 28px;
  box-shadow:
    0 18px 45px rgba(28, 21, 84, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.8);
  animation: fadeIn 0.45s ease-out;
}

.onboarding-step.active {
  display: block;
}

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

.onboarding-step.active {
  animation: slideIn 0.35s ease-out;
}

/* HERO SUPERIOR (bienvenida) */
.onboarding-hero {
  text-align: center;
  margin-bottom: 32px;
}

.onboarding-logo {
  width: 84px;
  height: 84px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #ffcff9, transparent 55%),
              radial-gradient(circle at 70% 70%, #d0e0ff, transparent 55%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboarding-logo img {
  max-width: 56px;
  max-height: 56px;
}

.onboarding-hero h1 {
  font-size: 2.3rem;
  font-weight: 800;
  color: #1b1033;
  margin-bottom: 12px;
  line-height: 1.2;
}

.onboarding-hero p {
  font-size: 1.05rem;
  color: #6b6b8a;
  line-height: 1.6;
  max-width: 640px;
  margin: 0 auto;
}

/* Tarjetas de features tipo landing */
.onboarding-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 32px 0 10px;
}

.feature-card {
  background: linear-gradient(145deg, #f9f7ff 0, #ffffff 45%, #f7fbff 100%);
  border-radius: 18px;
  padding: 20px 18px;
  text-align: left;
  border: 1px solid rgba(123, 103, 255, 0.15);
  box-shadow: 0 12px 28px rgba(54, 33, 146, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(54, 33, 146, 0.16);
  border-color: rgba(123, 103, 255, 0.4);
}

.feature-icon {
  font-size: 2.1rem;
  margin-bottom: 10px;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #221b3f;
  margin-bottom: 6px;
}

.feature-card p {
  color: #6d6e8e;
  line-height: 1.45;
  font-size: 0.93rem;
}

/* Header de pasos */
.onboarding-header {
  text-align: center;
  margin-bottom: 24px;
}

.onboarding-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1b1033;
  margin-bottom: 6px;
}

.onboarding-header p {
  font-size: 0.98rem;
  color: #6b6b8a;
}

/* Barra de progreso */
.onboarding-progress-container {
  width: 100%;
  height: 7px;
  background: #edf0ff;
  border-radius: 999px;
  margin: 18px 0 14px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.onboarding-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #6b53ff 0%, #9f5cff 40%, #ff6ac0 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.onboarding-step-counter {
  text-align: center;
  color: #7c7fa4;
  font-size: 0.86rem;
  margin-bottom: 18px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* Formularios */
.onboarding-form {
  background: #fafbff;
  border-radius: 18px;
  padding: 24px 24px 16px;
  margin: 18px 0 10px;
  border: 1px solid rgba(180, 187, 255, 0.45);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #262445;
  margin-bottom: 6px;
  font-size: 0.96rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid #e2e5ff;
  border-radius: 10px;
  font-size: 0.96rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  background: #ffffff;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #b0b3d1;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #7a66ff;
  box-shadow: 0 0 0 3px rgba(122, 102, 255, 0.2);
  background-color: #ffffff;
}

.form-group small {
  display: block;
  color: #8689b0;
  font-size: 0.82rem;
  margin-top: 4px;
}

/* Grid de actividades */
.activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 14px 0 6px;
}

.activity-chip {
  display: flex;
  align-items: center;
  padding: 14px 14px;
  background: #ffffff;
  border: 2px solid #e2e5ff;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  font-weight: 500;
  color: #333553;
  box-shadow: 0 4px 10px rgba(40, 40, 102, 0.04);
  user-select: none;
}

.activity-chip:hover {
  border-color: #7a66ff;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(51, 38, 132, 0.12);
}

/* Estados seleccionado/activo */
.activity-chip.selected,
.activity-chip.active {
  background: linear-gradient(135deg, #6b53ff, #a656ff);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(63, 43, 158, 0.55);
}

.activity-chip.selected .chip-icon,
.activity-chip.active .chip-icon {
  opacity: 1;
}

.chip-icon {
  margin-right: 10px;
  font-size: 1.25rem;
  opacity: 0.9;
}

/* BOTONES CORREGIDOS - LOOK & FEEL DECLARA */
.onboarding-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 26px;
  border-radius: 999px;
  border: none;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Botón primario */
.btn-primary {
  background: linear-gradient(135deg, #6b53ff, #ff4ed2);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(94, 65, 214, 0.45);
  border: 0;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5a44eb, #f53ec4);
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(79, 57, 196, 0.6);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 7px 18px rgba(60, 44, 157, 0.55);
}

/* Botón grande */
.btn-large {
  padding: 14px 34px;
  font-size: 1.03rem;
  min-width: 190px;
}

/* Botón ghost */
.btn-ghost {
  background: rgba(255, 255, 255, 0.9);
  color: #6b53ff;
  border: 2px solid rgba(107, 83, 255, 0.4);
  box-shadow: 0 8px 20px rgba(44, 33, 118, 0.12);
}

.btn-ghost:hover {
  background: #6b53ff;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(44, 33, 118, 0.3);
}

.btn-ghost:active {
  transform: translateY(0);
}

/* Botón deshabilitado */
.btn-disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
  transform: none;
}

/* Navegación inferior */
.onboarding-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(210, 214, 255, 0.8);
}

.onboarding-navigation-left {
  display: flex;
  gap: 10px;
  align-items: center;
}

.onboarding-navigation-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Estados responsivos */
@media (max-width: 768px) {
  .onboarding-flow {
    padding: 24px 14px 28px;
  }

  .onboarding-step {
    padding: 22px 18px 18px;
    border-radius: 18px;
  }

  .onboarding-hero h1 {
    font-size: 1.8rem;
  }

  .onboarding-features {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .onboarding-form {
    padding: 18px 14px 12px;
  }

  .activities-grid {
    grid-template-columns: 1fr;
  }

  .onboarding-navigation {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .onboarding-navigation .btn {
    width: 100%;
  }

  .btn {
    min-width: 0;
    width: auto;
    padding-inline: 20px;
  }
}

/* Estados de error y éxito */
#enhancedErrorContainer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #fff1f4, #ffffff);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.error-content {
  max-width: 520px;
  background: #ffffff;
  border-radius: 20px;
  padding: 28px 26px 22px;
  box-shadow: 0 18px 40px rgba(189, 44, 75, 0.22);
  border: 1px solid rgba(222, 68, 102, 0.3);
}

.error-content h2 {
  color: #dc3545;
  font-size: 1.7rem;
  margin-bottom: 12px;
}

.error-content p {
  color: #666;
  font-size: 0.98rem;
  margin-bottom: 18px;
}

/* Pantalla de finalización */
.onboarding-completion,
.onboarding-error {
  text-align: center;
  padding: 12px 6px 6px;
}

.completion-icon,
.error-icon {
  font-size: 2.6rem;
  margin-bottom: 8px;
}

.onboarding-completion h2,
.onboarding-error h2 {
  font-size: 1.7rem;
  font-weight: 700;
  color: #1b1033;
  margin-bottom: 8px;
}

.onboarding-completion p,
.onboarding-error p {
  color: #6b6b8a;
  font-size: 0.96rem;
}

.completion-features {
  list-style: none;
  padding: 0;
  margin: 18px auto 22px;
  max-width: 420px;
  text-align: left;
}

.completion-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.94rem;
  color: #363757;
  padding: 6px 0;
}

/* Animaciones de botón de carga */
.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Accesibilidad: enfoque visible */
.btn:focus-visible,
.activity-chip:focus-visible {
  outline: 3px solid rgba(107, 83, 255, 0.5);
  outline-offset: 3px;
}

/* Utilidades */
.hidden {
  display: none !important;
}
