@media (min-width: 1024px) {
  :root {
    --registro-desktop-gap: 32px;
    --registro-desktop-padding: 40px;
  }

  /* ============================================================================
     CORRECCIÓN CRÍTICA: Eliminar scroll innecesario en versión web
     ============================================================================ */

  html,
  body {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden;
    /* IMPORTANTE: overflow-y: auto permite scroll cuando el contenido excede la altura visible */
    /* Esto es correcto - el scroll funciona cuando hay mucho contenido */
    overflow-y: auto;
  }

  body {
    background: radial-gradient(circle at top, rgba(26, 31, 113, 0.08), transparent 55%),
      linear-gradient(180deg, #f6f8ff 0%, #eef2ff 60%, #f8fafc 100%) !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding: 16px !important;
    min-height: 100vh;
  }

  /* Alta especificidad para sobrescribir min-height: 100vh de registro.css */
  .container,
  .container.registration-app {
    max-width: 1100px !important;
    min-height: auto !important;
    height: auto !important;
    margin: 0 auto 16px !important;
    border-radius: 24px;
    padding: 0 !important;
    padding-bottom: 24px !important;
    box-shadow:
      0 24px 60px rgba(15, 23, 42, 0.12),
      0 12px 24px rgba(26, 31, 113, 0.12);
    overflow: visible !important;
  }

  .registration-app {
    display: flex;
    flex-direction: column;
  }

  .header {
    padding: 16px var(--registro-desktop-padding) 12px;
    text-align: left;
  }

  .header-actions {
    top: 16px;
    right: 24px;
  }

  .logo-container {
    justify-content: flex-start;
  }

  .logo-identity {
    align-items: flex-start;
  }

  .subtitle {
    text-align: left;
  }

  .progress-container {
    padding: 8px var(--registro-desktop-padding) 8px;
  }

  .content {
    padding: 16px var(--registro-desktop-padding) 20px !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 0 0 auto !important;
    align-items: stretch;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Steps no activos: completamente ocultos y sin ocupar espacio */
  .step:not(.active) {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    height: 0 !important;
    overflow: hidden !important;
  }

  .step {
    padding: 0;
    gap: 24px;
  }

  /* Step activo: layout de grid, sin restricciones de altura */
  .step.active {
    display: grid !important;
    grid-template-columns: minmax(280px, 0.85fr) minmax(480px, 1.15fr);
    gap: var(--registro-desktop-gap);
    align-items: start;
    align-content: start;
    min-height: auto !important;
    height: auto !important;
    position: relative !important;
    /* CRÍTICO: Eliminar restricciones de altura y scroll para versión web */
    max-height: none !important;
    overflow: visible !important;
    overflow-y: visible !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .step-content {
    min-width: 0;
  }

  .step-info {
    gap: 20px;
    padding-right: 12px;
    min-width: 0;
  }

  .step-title {
    font-size: 30px;
  }

  .step-description {
    font-size: 16px;
  }

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

  .form-label {
    font-size: 14px;
  }

  .form-input {
    padding: 16px 20px;
  }

  .form-input[type="file"] {
    padding: 14px 18px;
  }

  .input-group {
    gap: 16px;
    align-items: flex-start;
  }

  .input-group .form-group {
    min-width: 0;
  }

  .select-grid+.form-group {
    margin-top: 4px;
  }

  .select-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
  }

  .button-group {
    gap: 16px;
    justify-content: flex-start;
  }

  .button-group .btn {
    min-width: 180px;
  }

  .form-note,
  .form-status-message {
    font-size: 13px;
  }

  .option-card {
    min-height: 110px;
  }

  .document-upload-dropzone {
    padding: 22px 24px;
    gap: 20px;
  }

  .document-upload-preview {
    max-width: 420px;
  }

  .document-upload-feedback {
    gap: 12px;
  }

  .document-upload-title {
    font-size: 16px;
  }

  .document-upload-subtitle {
    font-size: 13px;
  }

  .document-signature-actions {
    justify-content: flex-start;
  }

  .document-signature-actions .btn {
    min-width: 200px;
  }

  .connection-overlay-card,
  .support-overlay-card,
  .exit-overlay-card,
  .signature-overlay-card {
    max-width: 720px;
  }

  .signature-overlay-body {
    gap: 24px;
  }

  .signature-canvas-wrapper {
    max-width: 520px;
  }

  .signature-overlay-guidelines {
    padding: 24px;
  }

  .signature-overlay-guidelines ul {
    gap: 12px;
  }

  .security-warning {
    padding: 20px 24px;
  }

  .security-warning__icon {
    width: 56px;
    height: 56px;
  }

  #step0 .welcome-screen {
    max-width: none;
  }

  #step0 .welcome-start {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }

  #step0 .welcome-screen--info {
    align-items: center;
    text-align: center;
  }

  #step19 .welcome-screen--info {
    align-items: flex-start;
    text-align: left;
  }

  #step22.step.active {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  #step22 .step-info {
    align-items: center;
    text-align: center;
    max-width: 720px;
  }

  #step22 .welcome-screen--info {
    align-items: center;
    text-align: center;
  }

  #step22 .button-group {
    justify-content: center;
  }

  .phone-overlay {
    position: fixed;
    inset: 0;
    margin: 0;
    justify-content: center;
    align-items: center;
  }

  .phone-overlay-card {
    margin: 0 auto;
  }

  #step0 .welcome-start__cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 420px;
  }

  #step0 .welcome-start__media {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 640px;
    width: 100%;
  }

  #step0 .welcome-video {
    max-width: 100%;
    width: 100%;
  }

  #step19 .welcome-start {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(360px, 1fr);
    align-items: center;
    gap: 32px;
  }

  #step19 .welcome-start__cta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    max-width: 460px;
  }

  #step19 .welcome-start__media {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 520px;
  }

  #step0 .welcome-start__cta .button-group {
    justify-content: center;
  }

  #step0 .welcome-start__cta p {
    text-align: center;
  }

  #step0.step.active {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  #step0 .step-info {
    align-items: center;
    text-align: center;
    padding-right: 0;
    max-width: 720px;
  }

  #step0 .step-content {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  #step20 .step-info,
  #step20 .step-content {
    max-width: 640px;
  }

  .summary-card,
  .confirmation-card {
    padding: 28px 32px;
  }

  .summary-card__row {
    gap: 12px;
  }

  .summary-card__label {
    font-size: 13px;
  }

  .summary-card__value {
    font-size: 15px;
  }

  .usa-bank-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .initial-recharge-form-card {
    padding: 28px 32px;
  }

  .pin-input {
    gap: 16px;
  }

  .pin-digit {
    width: 56px;
    height: 56px;
    font-size: 22px;
  }

  .otp-inputs {
    gap: 14px;
  }

  .otp-inputs input {
    width: 54px;
    height: 54px;
    font-size: 20px;
  }

  .progress-steps {
    gap: 10px;
  }

  .progress-step {
    width: 48px;
  }

  .progress-text {
    font-size: 13px;
  }

  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .info-card {
    padding: 20px 22px;
  }

  .upload-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .preview-card {
    padding: 20px;
  }

  .connection-overlay-content {
    gap: 24px;
  }

  .connection-overlay-quick {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .connection-overlay-actions {
    justify-content: center;
  }

  .support-overlay-actions {
    justify-content: center;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1320px;
  }

  .content {
    grid-template-columns: minmax(360px, 0.85fr) minmax(560px, 1.15fr);
    gap: 48px;
    overflow: visible;
  }

  .step.active {
    max-height: none !important;
    overflow: visible !important;
  }

  .step-title {
    font-size: 32px;
  }

  .step-description {
    font-size: 17px;
  }
}

/* ============================================================================
   OPTIMIZACIÓN VERSIÓN WEB: Correcciones específicas por paso
   ============================================================================ */
@media (min-width: 1024px) {

  /* CORRECCIÓN PRINCIPAL: Eliminar espacio vacío entre header y contenido */
  .step.active {
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Pasos de formulario (1-7, etc): Layout compacto sin scroll */
  #step1.step.active,
  #step2.step.active,
  #step3.step.active,
  #step4.step.active,
  #step5.step.active,
  #step6.step.active,
  #step7.step.active {
    grid-template-columns: minmax(250px, 0.7fr) minmax(400px, 1.3fr);
    gap: 24px;
    align-items: start;
    align-content: start;
  }

  /* Títulos más compactos en pasos de formulario */
  #step1 .step-title,
  #step2 .step-title,
  #step3 .step-title,
  #step4 .step-title,
  #step5 .step-title,
  #step6 .step-title,
  #step7 .step-title {
    font-size: 24px;
    line-height: 1.3;
    margin-bottom: 4px;
  }

  #step1 .step-description,
  #step2 .step-description,
  #step3 .step-description,
  #step4 .step-description,
  #step5 .step-description,
  #step6 .step-description,
  #step7 .step-description {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 0;
  }

  #step1 .step-info,
  #step2 .step-info,
  #step3 .step-info,
  #step4 .step-info,
  #step5 .step-info,
  #step6 .step-info,
  #step7 .step-info {
    gap: 8px;
    padding-right: 16px;
  }

  /* Paso 0: Bienvenida - Compactar para evitar scroll */
  #step0.step.active {
    grid-template-columns: 1fr;
    max-width: 900px;
    margin: 0 auto;
  }

  #step0 .welcome-hero-section {
    max-height: 260px;
    overflow: hidden;
  }

  #step0 .welcome-highlights {
    padding: 12px 0;
  }

  #step0 .welcome-highlights-grid {
    gap: 12px;
  }

  #step0 .welcome-footer-links {
    padding: 8px 0;
  }

  /* Paso 8: Verificación de correo - Compactar elementos */
  #step8.step.active,
  #step9.step.active,
  #step10.step.active,
  #step11.step.active,
  #step12.step.active,
  #step13.step.active,
  #step14.step.active,
  #step15.step.active,
  #step16.step.active,
  #step17.step.active,
  #step18.step.active,
  #step19.step.active,
  #step20.step.active,
  #step21.step.active {
    grid-template-columns: minmax(250px, 0.7fr) minmax(400px, 1.3fr);
    gap: 24px;
    align-items: start;
    align-content: start;
  }

  #step8 .step-info,
  #step9 .step-info,
  #step10 .step-info,
  #step11 .step-info,
  #step12 .step-info,
  #step13 .step-info,
  #step14 .step-info,
  #step15 .step-info,
  #step16 .step-info,
  #step17 .step-info,
  #step18 .step-info,
  #step19 .step-info,
  #step20 .step-info,
  #step21 .step-info {
    gap: 8px;
    padding-right: 16px;
  }

  #step8 .personalized-message {
    padding: 12px 16px;
    margin-bottom: 8px;
  }

  #step8 .info-message {
    padding: 12px 16px;
    margin-top: 12px;
  }

  #step8 .btn-request-code {
    padding: 12px 20px;
    margin: 8px 0;
  }

  /* Ajustar step-info y step-content para que no fuercen alturas innecesarias */
  .step-info,
  .step-content {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  /* Button group siempre visible sin necesidad de scroll */
  .button-group {
    position: relative;
    margin-top: auto;
    padding-top: 16px;
    flex-shrink: 0;
  }

  /* Formularios compactos */
  .form-group {
    margin-bottom: 16px;
  }

  /* Mensajes personalizados más compactos */
  .personalized-message {
    padding: 12px 16px;
  }

  /* Info messages más compactos */
  .info-message {
    padding: 12px 16px;
  }

  /* Select grid optimizado */
  .select-grid {
    gap: 12px;
  }

  .option-card {
    min-height: auto;
    padding: 16px 14px;
  }

  /* ============================================================================
     CORRECCIONES OVERLAYS DE TELÉFONO - Versión web
     ============================================================================ */

  /* 1. Phone Overlay (prefijo) - Permitir scroll y centrar */
  .phone-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 99998 !important;
    padding: 20px !important;
    overflow: auto !important;
  }

  .phone-overlay-card {
    position: relative !important;
    max-width: 520px !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    margin: auto !important;
  }

  /* 2. Phone Confirm Overlay - Centrar correctamente */
  .phone-confirm-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 99998 !important;
    padding: 20px !important;
    background: rgba(26, 31, 113, 0.85) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
  }

  .phone-confirm-overlay>div,
  .phone-confirm-overlay .phone-confirm-card,
  .phone-confirm-overlay .phone-overlay-card {
    position: relative !important;
    max-width: 480px !important;
    margin: 0 auto !important;
    background: #ffffff !important;
    border-radius: 24px !important;
    padding: 28px !important;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.3) !important;
  }

  /* ============================================================================
     PASO DE TARJETA DIGITAL - Texto ordenado en desktop
     ============================================================================ */

  /* Paso 16: Tarjeta personalizada - Layout grid de 2 columnas */
  #step16.step.active {
    display: grid !important;
    grid-template-columns: minmax(300px, 1fr) minmax(400px, 1.2fr) !important;
    gap: 32px !important;
    align-items: start !important;
  }

  #step16 .step-info {
    padding-right: 16px;
    gap: 16px !important;
  }

  #step16 .step-title {
    font-size: 26px !important;
    line-height: 1.3 !important;
  }

  #step16 .step-description {
    font-size: 15px !important;
    line-height: 1.6 !important;
    color: #64748b;
  }

  /* ============================================================================
     PASO 16 y 17: Formato mejorado de cajas de instrucciones
     ============================================================================ */
  #step16 .info-message,
  #step17 .info-message {
    font-size: 13px !important;
    line-height: 1.9 !important;
    padding: 16px 18px !important;
    background: rgba(26, 31, 113, 0.04) !important;
    border-radius: 12px !important;
    border-left: 3px solid var(--visa-blue, #1a1f71) !important;
    white-space: normal !important;
  }

  #step16 .info-message strong,
  #step17 .info-message strong {
    display: block !important;
    margin-bottom: 10px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid rgba(26, 31, 113, 0.1) !important;
    color: var(--visa-blue, #1a1f71) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
  }

  /* Mejora visual de instrucciones inline para step16 - "Generar tarjeta" */
  #step16 .info-message strong:not(:first-child) {
    display: inline !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
    background: rgba(26, 31, 113, 0.08) !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
  }

  #step16 .step-content {
    min-width: 0;
  }

  #step16 .wrapper,
  #step16 .card-form {
    width: 100% !important;
  }

  #step16 .card-list {
    margin-bottom: 20px !important;
  }

  #step16 .card-item {
    max-width: 380px !important;
    margin: 0 auto 20px !important;
  }

  /* ============================================================================
     OVERLAY "CONOCE MÁS" - Corrección DEFINITIVA para versión web
     Garantiza que sea un overlay REAL de pantalla completa centrado
     IMPORTANTE: Debe romper cualquier contexto de stacking/contención
     ============================================================================ */
  .know-more-overlay {
    /* Posicionamiento fijo absoluto respecto al viewport */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    /* Z-index máximo para estar encima de todo */
    z-index: 999999 !important;
    /* Centrado del contenido */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    /* Padding para que no toque los bordes */
    padding: 20px !important;
    margin: 0 !important;
    /* Romper CUALQUIER contexto de contención o transform del padre */
    contain: none !important;
    isolation: isolate !important;
    transform: none !important;
    /* Asegurar que no herede propiedades problemáticas */
    max-width: none !important;
    max-height: none !important;
    overflow: hidden !important;
    /* Background transparente - el backdrop maneja el fondo */
    background: transparent !important;
  }

  /* Cuando está visible, bloquear scroll del body */
  .know-more-overlay.visible {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* Backdrop: fondo oscuro con blur */
  .know-more-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: linear-gradient(135deg, rgba(26, 31, 113, 0.92) 0%, rgba(13, 17, 66, 0.96) 100%) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    z-index: -1 !important;
    cursor: pointer;
  }

  /* Card del overlay: el contenido principal */
  .know-more-card {
    position: relative !important;
    z-index: 1 !important;
    width: 100% !important;
    max-width: 560px !important;
    max-height: 80vh !important;
    margin: 0 auto !important;
    background: #ffffff !important;
    border-radius: 24px !important;
    padding: 28px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-shadow:
      0 40px 80px rgba(10, 12, 42, 0.45),
      0 16px 32px rgba(26, 31, 113, 0.25),
      0 0 0 1px rgba(255, 255, 255, 0.15) !important;
    /* Animación de entrada */
    transform: translateY(0) scale(1) !important;
  }

  /* Evitar scroll en el body cuando el overlay está visible */
  body.know-more-open,
  body:has(.know-more-overlay.visible) {
    overflow: hidden !important;
  }

  /* Compactar contenido del overlay para evitar scroll interno */
  .know-more-header {
    text-align: center;
    margin-bottom: 20px;
  }

  .know-more-logo-badge {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
  }

  .know-more-title {
    font-size: 24px;
    margin-bottom: 6px;
  }

  .know-more-subtitle {
    font-size: 14px;
  }

  .know-more-video-section {
    margin: 16px 0;
  }

  .know-more-video-wrapper {
    max-width: 200px;
    margin: 0 auto;
  }

  .know-more-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 16px 0;
  }

  .know-more-feature {
    padding: 12px 8px;
  }

  .know-more-tabs {
    margin: 16px 0 12px;
  }

  .know-more-tab-content {
    min-height: 100px;
    max-height: 150px;
    overflow-y: auto;
  }

  .know-more-cta {
    margin-top: 16px;
  }

  .know-more-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    z-index: 10;
  }
}