/**
 * RIDER TRIP MÉXICO - App Web Onboarding & Profiling (assets/css/app/onboarding.css)
 * 
 * TEMA BLANCO / LIGHT THEME PREMIUM:
 * Diseño limpio, claro, acogedor y de alto contraste visual.
 * Estilos modulares e independientes exclusivos para la app web.
 */

:root {
  --app-bg: #f8fafc;
  --app-surface: #ffffff;
  --app-surface-hover: #f1f5f9;
  --app-surface-active: #e2e8f0;
  --app-border: #e2e8f0;
  --app-border-hover: #cbd5e1;
  --app-text: #0f172a;
  --app-text-muted: #64748b;
  --app-red: #D71920;
  --app-red-glow: rgba(215, 25, 32, 0.22);
  --app-blue: #1769FF;
  --app-blue-glow: rgba(23, 105, 255, 0.22);
  --app-green: #10b981;
  --app-green-glow: rgba(16, 185, 129, 0.22);
  --app-radius: 18px;
  --app-radius-sm: 12px;
}

/* Contenedor Principal de la App (Tema Blanco & Tipografía Nunito) */
.rt-app-layout {
  min-height: 100vh;
  background-color: var(--app-bg);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(215, 25, 32, 0.04) 0%, transparent 45%),
    radial-gradient(circle at 90% 90%, rgba(23, 105, 255, 0.04) 0%, transparent 45%);
  color: var(--app-text);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-optical-sizing: auto;
}

/* Aplicación Universal de Nunito (Idéntico a la Landing Page) */
.rt-app-layout,
.rt-app-layout button,
.rt-app-layout input,
.rt-app-layout select,
.rt-app-layout textarea,
.rt-app-layout h1,
.rt-app-layout h2,
.rt-app-layout h3,
.rt-app-layout h4,
.rt-app-layout p,
.rt-app-layout span,
.rt-app-layout label {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* Barra Superior de la App (App Bar Blanco) */
.rt-app-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--app-border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.85rem 1.25rem;
}

.rt-app-header-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.rt-app-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #0f172a;
}

.rt-app-logo img {
  height: 36px;
  width: auto;
}

.rt-app-step-indicator {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--app-text-muted);
}

.rt-app-step-indicator strong {
  color: #0f172a;
}

/* Botón Salir en Header Superior */
.rt-app-btn-exit {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.95rem;
  border-radius: 50px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  line-height: 1.2;
}

.rt-app-btn-exit:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Animación de Validación / Alerta */
@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.shake-error {
  animation: shakeError 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Barra de Progreso Dinámica */
.rt-app-progress-wrap {
  width: 100%;
  height: 4px;
  background: #e2e8f0;
  position: absolute;
  bottom: 0;
  left: 0;
}

.rt-app-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--app-red) 0%, var(--app-blue) 100%);
  width: 25%;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px var(--app-red-glow);
}

/* Área Central de Contenido del Onboarding */
.rt-app-main {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 3vw, 2.5rem) 1rem clamp(2rem, 4vw, 3.5rem);
}

.rt-app-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

/* Tarjeta Contenedora de Pasos (Blanco Puro con Sombra Suave) */
.rt-onboarding-card {
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.02);
  position: relative;
  overflow: hidden;
  animation: appCardFadeIn 0.35s ease forwards;
}

@keyframes appCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Tipografía de Pasos */
.rt-step-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--app-red);
  margin-bottom: 0.5rem;
}

.rt-step-title {
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 900;
  color: #0f172a;
  line-height: 1.3;
  margin-bottom: 0.6rem;
}

.rt-step-desc {
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  color: var(--app-text-muted);
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

/* Estilos de Formulario y Campos Táctiles */
.rt-app-form-group {
  margin-bottom: 1.25rem;
}

.rt-app-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #334155;
  margin-bottom: 0.45rem;
}

.rt-app-label-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--app-text-muted);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 0.4rem;
}

.rt-app-input,
.rt-app-select {
  width: 100%;
  height: 52px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--app-radius-sm);
  color: #0f172a;
  font-size: 1.05rem;
  padding: 0 1.15rem;
  transition: all 0.22s ease;
  outline: none;
}

.rt-app-input:focus,
.rt-app-select:focus {
  border-color: var(--app-red);
  box-shadow: 0 0 0 3px var(--app-red-glow);
  background: #ffffff;
}

.rt-app-input::placeholder {
  color: #94a3b8;
}

.rt-app-select option {
  background: #ffffff;
  color: #0f172a;
}

/* Cuadrícula de Vehículos Táctil (Paso 2) */
.rt-vehicle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

@media (min-width: 576px) {
  .rt-vehicle-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.rt-vehicle-option {
  position: relative;
  background: #f8fafc;
  border: 1.5px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  padding: 1.15rem 0.85rem;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 112px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.rt-vehicle-option:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.rt-vehicle-option.is-selected {
  background: #fff5f5;
  border-color: var(--app-red);
  box-shadow: 0 4px 16px rgba(215, 25, 32, 0.16);
  transform: translateY(-2px);
}

.rt-vehicle-icon {
  font-size: 1.85rem;
  line-height: 1;
}

.rt-vehicle-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  line-height: 1.2;
}

.rt-vehicle-sub {
  font-size: 0.68rem;
  color: var(--app-text-muted);
  margin: 0;
}

.rt-vehicle-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--app-red);
  color: #ffffff;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.2s ease;
}

.rt-vehicle-option.is-selected .rt-vehicle-check {
  opacity: 1;
  transform: scale(1);
}

/* Pills y Switches Táctiles (Paso 3 y 4) */
.rt-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.rt-pill-option {
  background: #ffffff;
  border: 1.5px solid var(--app-border);
  border-radius: 50px;
  padding: 0.6rem 1.15rem;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  min-height: 44px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.rt-pill-option:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.rt-pill-option.is-selected {
  background: var(--app-red);
  border-color: var(--app-red);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--app-red-glow);
}

.rt-pill-option.pill-blue.is-selected {
  background: var(--app-blue);
  border-color: var(--app-blue);
  box-shadow: 0 4px 14px var(--app-blue-glow);
}

/* Tarjetas de Experiencia en Clubes (Paso 4) */
.rt-experience-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.rt-exp-card {
  background: #ffffff;
  border: 1.5px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.22s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.rt-exp-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.rt-exp-card.is-selected {
  background: #eff6ff;
  border-color: var(--app-blue);
  box-shadow: 0 4px 16px var(--app-blue-glow);
}

.rt-exp-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.rt-exp-badge-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.rt-exp-card.is-selected .rt-exp-badge-icon {
  background: var(--app-blue);
  color: #ffffff;
  border-color: var(--app-blue);
}

.rt-exp-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.rt-exp-desc {
  font-size: 0.78rem;
  color: var(--app-text-muted);
  margin: 0;
}

/* Botones de Navegación del Onboarding */
.rt-app-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--app-border);
}

.rt-app-btn-back {
  background: #ffffff;
  border: 1.5px solid var(--app-border);
  color: #475569;
  padding: 0.75rem 1.25rem;
  border-radius: var(--app-radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  min-height: 48px;
}

.rt-app-btn-back:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}

.rt-app-btn-next {
  background: var(--app-red);
  border: none;
  color: #ffffff;
  padding: 0.75rem 1.75rem;
  border-radius: var(--app-radius-sm);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 6px 20px var(--app-red-glow);
  transition: all 0.22s ease;
  min-height: 48px;
  flex: 1 0 auto;
}

.rt-app-btn-next:hover {
  background: #bf151b;
  box-shadow: 0 8px 25px rgba(215, 25, 32, 0.45);
  transform: translateY(-2px);
}

.rt-app-btn-next:active {
  transform: translateY(0);
}

/* ==========================================================================
   PANTALLA DE RESULTADOS / MATCHMAKING (Paso 5 - Tema Blanco)
   ========================================================================== */
.rt-profile-preview-card {
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.04);
}

.rt-profile-preview-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--app-red), var(--app-blue));
}

.rt-pilot-header {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
}

.rt-pilot-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--app-red);
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px var(--app-red-glow);
  border: 2px solid #ffffff;
}

.rt-pilot-name {
  font-size: 1.35rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0;
  line-height: 1.2;
}

.rt-pilot-roadname {
  font-size: 0.85rem;
  color: var(--app-red);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.rt-pilot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rt-pilot-tag-pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
}

/* Matchmaking de Clubes */
.rt-match-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.rt-match-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rt-match-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.rt-club-match-card {
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-sm);
  padding: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.25s ease;
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.rt-club-match-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.rt-club-info {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex: 1 1 240px;
}

.rt-club-logo-circle {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--app-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.rt-club-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.2rem 0;
}

.rt-club-meta {
  font-size: 0.74rem;
  color: var(--app-text-muted);
  margin: 0;
}

.rt-match-score {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  color: #059669;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.rt-btn-connect-club {
  background: var(--app-blue);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  padding: 0.45rem 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.rt-btn-connect-club:hover {
  background: #0d54d9;
  box-shadow: 0 4px 12px var(--app-blue-glow);
}

/* Botón de Reset Demo */
.rt-demo-reset-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--app-radius-sm);
  padding: 1rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--app-text-muted);
}

.rt-btn-reset-demo {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: all 0.2s ease;
}

.rt-btn-reset-demo:hover {
  border-color: var(--app-red);
  color: var(--app-red);
}

/* ==========================================================================
   VISTA DE INGRESO / LOGIN (login.php)
   ========================================================================== */
.rt-login-wrap {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.rt-login-card {
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.02);
  position: relative;
  overflow: hidden;
  animation: appCardFadeIn 0.35s ease forwards;
}

.rt-login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--app-red), var(--app-blue));
}

.rt-login-logo {
  display: inline-block;
  margin-bottom: 1.25rem;
  transition: transform 0.2s ease;
}

.rt-login-logo:hover {
  transform: scale(1.03);
}

.rt-login-logo img {
  height: 62px;
  width: auto;
}

.rt-login-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.rt-login-title {
  font-size: 1.55rem;
  font-weight: 900;
  color: #0f172a;
  margin: 0 0 0.35rem 0;
}

.rt-login-subtitle {
  font-size: 0.85rem;
  color: var(--app-text-muted);
  margin: 0;
}

.rt-input-icon-wrap {
  position: relative;
}

.rt-input-icon-wrap .rt-app-input {
  padding-left: 2.75rem;
  padding-right: 2.75rem;
}

.rt-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1rem;
  pointer-events: none;
  transition: color 0.2s ease;
}

.rt-input-icon-wrap .rt-app-input:focus ~ .rt-input-icon {
  color: var(--app-red);
}

.rt-password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.rt-password-toggle:hover {
  color: #0f172a;
}

.rt-login-forgot-link {
  font-size: 0.82rem;
  color: #64748b;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.rt-login-forgot-link:hover {
  color: var(--app-red);
  text-decoration: underline;
}

.rt-login-btn-submit {
  width: 100%;
  height: 50px;
  background: var(--app-red);
  color: #ffffff;
  border: none;
  border-radius: var(--app-radius-sm);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--app-red-glow);
  transition: all 0.22s ease;
  margin-top: 1.25rem;
}

.rt-login-btn-submit:hover {
  background: #bf151b;
  box-shadow: 0 8px 25px rgba(215, 25, 32, 0.45);
  transform: translateY(-2px);
}

.rt-login-footer {
  text-align: center;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--app-border);
}

.rt-login-register-legend {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 0.6rem;
}

.rt-login-register-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #f8fafc;
  border: 1.5px solid var(--app-border);
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.55rem 1.25rem;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.rt-login-register-link:hover {
  background: #ffffff;
  border-color: var(--app-red);
  color: var(--app-red);
  box-shadow: 0 4px 14px rgba(215, 25, 32, 0.15);
  transform: translateY(-1px);
}
