/* =========================================
 HT WELCOME SPLASH - COMPACT V12=========================================*/

/* --- FONDO --- */
#welcome-splash .ht-immersive-background {
position: fixed;
  top: 0;
  left: 0;
  z-index: 1060;
  width: 100%;
  height: 100%;
  background-color: var(--color-primary);
  background-image:
    linear-gradient(to bottom, rgba(var(--color-primary-rgb), 0.75), rgba(var(--color-primary-rgb), 0.98)),
    var(--bg-image, none);
  background-position: center;
  background-size: cover;
}

#welcome-splash .ht-modal-immersive .modal-dialog {
display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  height: 100%;
  margin: 0 auto;
}

#welcome-splash .ht-welcome-card {
  position: relative;
  z-index: 1060;
  display: flex;
  flex-direction: column;
width: 100%;
  max-width: 480px;
  height: 100dvh;
  height: 100vh;
  max-height: 100dvh;
    max-height: 100vh;
  background: transparent;
  border: none;
}

/* --- HEADER (Optimizado para espacio) --- */
#welcome-splash .ht-welcome-header {
  flex-shrink: 0;
  max-height: 100px;
  padding-top: env(safe-area-inset-top, 10px);
  margin-bottom: 10px;
  text-align: center;
  transition: var(--transition-base);
}

#welcome-splash .ht-brand-logo {
  width: 130px;
  max-height: 80px;
  margin-bottom: 5px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  transition: var(--transition-base);
}

.ht-lang-btn {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: 10px;
  z-index: 15;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  outline: none;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(8px);
  transition: var(--transition-fast);
}
#welcome-splash .ht-welcome-title {
  margin: 0;
font-size: 1.6rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-inverse);
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

#welcome-splash .ht-welcome-text-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
margin-top: 5px;
}

#welcome-splash .ht-text-primary {
  margin: 0;
font-size: 1rem;
  color: var(--color-text-inverse);
}

#welcome-splash .ht-text-secondary {
  margin: 0 auto;
font-size: 0.85rem;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.8);
}

/* --- BODY (FORMULARIO) --- */
#welcome-splash .ht-welcome-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 10px 24px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
  overflow-y: auto;
  scrollbar-width: none;
}

#welcome-splash .ht-welcome-body::-webkit-scrollbar {
display: none;
}

/* Switcher (Pestañas) */
#welcome-splash .ht-auth-switcher {
  position: relative;
  display: flex;
  flex-shrink: 0;
  padding: 4px;
  margin-bottom: 20px;
background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-pill);
}

#welcome-splash .ht-auth-switcher input {
display: none;
}

#welcome-splash .ht-auth-switcher label {
  z-index: 2;
flex: 1;
  padding: 8px;
  margin: 0;
  font-size: 0.85rem;
  font-weight: var(--font-weight-semibold);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  cursor: pointer;
}

#welcome-splash .ht-auth-switcher input:checked+label {
color: var(--color-primary);
}

#welcome-splash .ht-switcher-bg {
position: absolute;
  top: 4px;
  left: 4px;
  z-index: 1;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: var(--color-bg-card);
  border-radius: var(--radius-pill);
  transition: transform 0.3s ease;
}

#welcome-splash #switch_res:checked~.ht-switcher-bg {
transform: translateX(100%);
}

/* --- LOGICA DE FILAS (AHORRO ESPACIO) --- */
#welcome-splash .ht-form-stack {
display: flex;
  flex-direction: column;
  gap: 12px;
}

/* La Fila Flexible */
#welcome-splash .ht-input-row {
display: flex;
  gap: 10px;
  width: 100%;
}

/* Los Grupos Dinámicos (50% -> 75% / 25%) */
#welcome-splash .ht-dynamic-group {
  position: relative;
flex: 1;
  /* Por defecto ocupan lo mismo (50%) */
  min-width: 0;
  /* Evita desbordamiento */
  transition: flex 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Cuando un grupo tiene el foco, crece */
#welcome-splash .ht-dynamic-group:focus-within {
flex: 3;
  /* Crece al 75% aprox */
}

/* Inputs */
#welcome-splash .ht-input-group {
position: relative;
  width: 100%;
}

#welcome-splash .ht-input-icon {
position: absolute;
  top: 13px;
  left: 15px;
  z-index: 5;
  font-size: 18px;
  /* Fixed position = half of 50px input height */
  color: var(--color-primary);
  transition: opacity 0.2s;
}

#welcome-splash .ht-form-control {
width: 100%;
  height: 50px;
  padding-right: 10px;
  padding-left: 42px;
  text-overflow: ellipsis;
  font-size: 0.9rem;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-heading) !important;
  background-color: var(--color-bg-card) !important;
  /* Bordes menos agresivos para encajar mejor en filas */
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: var(--transition-fast);
  /* Si el texto es largo en modo pequeño, que ponga ... */
}

#welcome-splash .ht-form-control::placeholder {
  font-weight: var(--font-weight-normal);
color: var(--color-text-muted) !important;
  white-space: nowrap;
}

#welcome-splash .ht-form-control:focus {
outline: none;
  border-color: var(--color-secondary);
}

/* Cuando el input está "aplastado" (no tiene foco y su hermano sí), ocultamos icono y reducimos padding */
#welcome-splash .ht-input-row:focus-within .ht-dynamic-group:not(:focus-within) .ht-input-icon {
opacity: 0;
  /* Ocultar icono para dejar espacio al texto */
}

#welcome-splash .ht-input-row:focus-within .ht-dynamic-group:not(:focus-within) .ht-form-control {
padding-left: 10px;
  /* Recuperar espacio */
  font-size: 0.8rem;
  color: var(--color-text-muted) !important;
}

/* Botón Principal */
#welcome-splash .ht-btn-primary {
  display: flex;
  flex-shrink: 0;
  gap: 10px;
  align-items: center;
  justify-content: center;
width: 100%;
  height: 52px;
  margin-top: 10px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-text-inverse);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  background: var(--color-secondary) !important;
  border: none;
  border-radius: var(--radius-pill);
  box-shadow: 0 5px 25px rgba(60, 199, 243, 0.5);
  transition: transform 0.2s;
}

#welcome-splash .ht-btn-primary:active {
transform: scale(0.98);
}

/* --- ZONA INFERIOR --- */
#welcome-splash .ht-welcome-bottom {
  position: sticky;
  bottom: 0;
  z-index: 10;
  flex-shrink: 0;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 15px);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
}

#welcome-splash .ht-actions-grid {
display: flex;
  gap: 10px;
  width: 90%;
  max-width: 450px;
  margin: 0 auto 15px auto;
}

#welcome-splash .ht-btn-secondary {
  display: flex;
flex: 1;
  gap: 8px;
  align-items: center;
  padding: 10px;
  cursor: pointer;
  background: rgba(30, 35, 50, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(12px);
}

#welcome-splash .ht-icon-box {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
}

#welcome-splash .ht-icon-box i {
  font-size: 18px;
color: var(--color-secondary);
}

#welcome-splash .ht-text-box {
flex: 1;
  overflow: hidden;
}

#welcome-splash .ht-text-box span {
  display: block;
  margin-bottom: 2px;
font-size: 0.65rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.7);
}

#welcome-splash .ht-text-box strong {
  display: block;
font-size: 0.75rem;
  font-weight: var(--font-weight-bold);
  line-height: 1;
  color: var(--color-text-inverse);
  text-transform: uppercase;
}

#welcome-splash .ht-footer-guest {
text-align: center;
}

#welcome-splash .ht-guest-link small {
  font-weight: 800;
color: var(--color-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

#welcome-splash .ht-guest-link span {
display: block;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

/* --- CHECKBOX DE PRIVACIDAD (Custom Style) --- */
#welcome-splash .ht-policy-check {
display: flex;
  /* Alineado arriba por si el texto ocupa 2 líneas */
  gap: 10px;
  align-items: flex-start;
  /* Un poco de margen para separar */
  padding: 0 5px;
  margin: 5px 0 5px 5px;
}

/* Ocultamos el checkbox nativo feo */
#welcome-splash .ht-policy-check input[type="checkbox"] {
  /* Que no se aplaste si hay mucho texto */
  position: relative;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  -webkit-appearance: none;
appearance: none;
  cursor: pointer;
  /* Cuadrado redondeado suave */
  background: rgba(255, 255, 255, 0.1);
  /* Tamaño táctil bueno */
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-xs);
  transition: var(--transition-fast);
}

/* Estado Marcado (Checked) */
#welcome-splash .ht-policy-check input[type="checkbox"]:checked {
background-color: var(--color-secondary);
  /* Cyan */
  border-color: var(--color-secondary);
}

/* El "Tick" del checkbox (dibujado con pseudo-elemento) */
#welcome-splash .ht-policy-check input[type="checkbox"]:checked::after {
  position: absolute;
  top: 1px;
  left: 5px;
  width: 6px;
  height: 12px;
content: '';
  border: solid #fff;
  /* Tick blanco */
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Texto del Label */
#welcome-splash .ht-policy-check label {
  margin-top: 1px;
  /* Ajuste fino para alinear con el checkbox */
  font-family: var(--font-family-base);
font-size: 0.8rem;
  line-height: 1.3;
  /* Pequeño pero legible */
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

/* Enlace dentro del label */
#welcome-splash .ht-policy-check label a {
  font-weight: var(--font-weight-semibold);
color: var(--color-text-inverse);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

#welcome-splash .ht-policy-check label a:hover {
color: var(--color-secondary);
}

#welcome-splash a#showlawtext {
padding-left: 6px;
}

/* Mensaje de error debajo del campo */
#welcome-splash .invalid-feedback {
display: none;
  width: 100%;
  padding: 4px 10px;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-inverse);
  background-color: rgba(220, 53, 69, 0.6);
  border-radius: var(--radius-sm);
}

/* =========================================
 3. TARJETA LEGAL / PRIVACIDAD (MODERNA)=========================================*/

/* El Contenedor Principal (Reemplaza al form default) */
#welcome-splash .ht-legal-card {
  position: relative;
  z-index: 1060;
  /* Altura máxima */
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 449px;
  /* Mismo ancho que el login */
  max-height: 90vh;
  overflow: hidden;
background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  /* Por encima de todo */
  animation: slideUpFade 0.3s ease-out;
}

/* --- HEADER --- */
#welcome-splash .ht-legal-header {
  flex-shrink: 0;
padding: 25px 25px 15px 25px;
  background: var(--color-bg-card);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

#welcome-splash .ht-legal-title {
  margin: 0 0 5px 0;
font-family: var(--font-family-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-primary);
}

#welcome-splash .ht-legal-subtitle {
  margin: 0;
font-size: 0.9rem;
  color: var(--color-text-subtle);
}

/* --- ÁREA DE SCROLL --- */
#welcome-splash .ht-legal-scroll-area {
  flex: 1;
padding: 10px 15px;
  overflow-y: auto;
  /* Ocupa el espacio restante */
  background: var(--color-bg-body);
  /* Fondo muy sutil para diferenciar del papel */
  /* font-size: 14px !important; */
}

/* Personalización del texto legal */
#welcome-splash .ht-legal-content {
font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text-body);
  text-align: left;
}

#welcome-splash .ht-legal-content p {
margin-bottom: 15px;
}

#welcome-splash .ht-legal-content strong {
  font-weight: var(--font-weight-bold);
color: var(--color-primary);
}

#welcome-splash .ht-legal-content a {
  font-weight: var(--font-weight-semibold);
color: var(--color-secondary);
  text-decoration: underline;
}

/* Scrollbar invisible pero funcional */
#welcome-splash .ht-legal-scroll-area::-webkit-scrollbar {
width: 4px;
}

#welcome-splash .ht-legal-scroll-area::-webkit-scrollbar-thumb {
background: var(--color-border-strong);
  border-radius: var(--radius-xs);
}

#welcome-splash .ht-legal-scroll-area::-webkit-scrollbar-track {
background: transparent;
}

/* --- FOOTER (BOTÓN) --- */
#welcome-splash .ht-legal-footer {
  flex-shrink: 0;
padding: 15px 25px 25px 25px;
  background: var(--color-bg-card);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.02);
  /* Sombra sutil hacia arriba */
}

/* Ajuste del botón para este contexto */
#welcome-splash .ht-legal-footer .ht-btn-primary {
  /* Quitamos margen extra */
  width: 100%;
margin-top: 0;
}

/* =========================================
 4. PIN SECURITY (iOS KEYPAD STYLE)=========================================*/

@keyframes slideUpFade {
from {
    opacity: 0;
    transform: translateY(20px);
  }

to {
  opacity: 1;
  transform: translateY(0);
}
}


/* VISUALIZADOR DE PUNTOS */
.ht-pin-display {
display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 30px;
}

.ht-pin-dot {
width: 16px;
  height: 16px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transition: var(--transition-fast);
}

.ht-pin-dot.active {
background: var(--color-bg-card);
  /* O var(--color-secondary) si quieres cyan */
  border-color: var(--color-bg-card);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* TECLADO VIRTUAL */
.ht-pin-keypad {
display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
  /* Espacio vertical entre filas */
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.ht-key-row {
display: flex;
  gap: 25px;
  justify-content: center;
  /* Espacio horizontal entre teclas */
  width: 100%;
}

/* BOTONES DEL TECLADO */
.ht-key-btn {
  display: flex;
  align-items: center;
  justify-content: center;
width: 65px;
  height: 65px;
  padding: 0;
  font-family: var(--font-family-base);
  font-size: 1.8rem;
  font-weight: var(--font-weight-normal);
  color: var(--color-text-inverse);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  /* Efecto Glass */
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  backdrop-filter: blur(5px);
  transition: background 0.1s;
}

.ht-key-btn:active {
background: rgba(255, 255, 255, 0.3);
  /* Feedback táctil */
}

/* Botón Borrar */
.ht-key-delete {
  color: rgba(255, 255, 255, 0.7);
background: transparent;
  border: none;
}

.ht-key-delete i {
font-size: 28px;
}

/* Botón Vacío (para alinear el 0) */
.ht-key-empty {
visibility: hidden;
  pointer-events: none;
  background: none;
  border: none;
}

/* Ajuste en pantallas muy pequeñas */
@media (max-height: 650px) {
.ht-pin-keypad {
    gap: 8px;
  }

.ht-key-row {
  gap: 15px;
}

.ht-key-btn {
  width: 55px;
  height: 55px;
  font-size: 1.5rem;
}
}

/* --- RESPONSIVE AGRESIVO (Para móviles con poca altura) --- */
@media (max-height: 750px) {

  /* Ocultar subtítulo para ganar espacio */
  #welcome-splash .ht-text-primary {
    display: none;
  }

  #welcome-splash .ht-welcome-header {
    max-height: 60px;
    padding-top: 5px;
    margin-bottom: 5px;
  }

  #welcome-splash .ht-brand-logo {
    width: 100px;
    max-height: 50px;
  }

  #welcome-splash .ht-welcome-title {
    font-size: 1.3rem;
  }

  #welcome-splash .ht-welcome-text-block {
    margin-bottom: 8px !important;
  }

  #welcome-splash .ht-form-control {
    height: 44px;
    font-size: 0.9rem;
  }

  #welcome-splash .ht-btn-primary {
    height: 46px;
  }
}

/* --- Pantallas extremadamente cortas (ej: iPhone SE landscape) --- */
@media (max-height: 550px) {

  #welcome-splash .ht-welcome-header {
    display: none;
  }

  #welcome-splash .ht-text-secondary {
    display: none;
  }

  #welcome-splash .ht-welcome-body {
    justify-content: flex-start;
    padding-top: 15px;
  }

  #welcome-splash .ht-welcome-bottom {
    padding-bottom: 10px;
  }
}

/* =========================================
 5. DESKTOP LAYOUT (min-width: 768px)
 =========================================*/
@media (min-width: 768px) {

  /* Card: no full-height, centered with auto height */
  #welcome-splash .ht-welcome-card {
    height: auto;
    max-height: 90vh;
    overflow: hidden;
    border-radius: var(--radius-lg);
  }

  /* Header: normal flow, centered */
  #welcome-splash .ht-welcome-header {
    position: relative;
    top: auto;
    left: auto;
    padding-top: 30px;
    text-align: center;
  }

  /* Body: more breathing room */
  #welcome-splash .ht-welcome-body {
    padding: 30px 40px;
  }

  /* Dialog: proper centering */
  #welcome-splash .ht-modal-immersive .modal-dialog {
    max-width: 480px;
    min-height: 100vh;
  }

  /* Bottom section: rounded within the card */
  #welcome-splash .ht-welcome-bottom {
    padding: 20px 30px 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, transparent 100%);
  }
}

/* =========================================
 6. INLINE ERROR MESSAGES
=========================================*/

.ht-splash-error {
    padding: 8px 12px;
    margin: 4px 0;
    font-size: 0.82rem;
    font-weight: var(--font-weight-semibold);
    color: #dc3545;
    text-align: center;
    background: rgba(220, 53, 69, 0.08);
    border-radius: var(--radius-md);
}

/* =========================================
 7. BOTÓN FLOTANTE DE IDIOMA
=========================================*/

/* Responsive: más pequeño en móviles */