/* ========================================
   LOGIN STYLES - Chat OnPremise
   ========================================
   
   Los colores se definen en theme.css
   ======================================== */

* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

html {
  height: 100%;
  height: -webkit-fill-available;
}

body { 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
  background: var(--bg-login); 
  color: var(--text-primary); 
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height - se ajusta con teclado virtual */
  min-height: -webkit-fill-available;
  display: flex; 
  align-items: center; 
  justify-content: center; 
  padding: 16px;
  overflow-y: auto; /* Permitir scroll cuando el teclado aparece */
}

/* Mejoras específicas para móviles */
@media screen and (max-width: 480px) {
  body {
    align-items: flex-start; /* En móvil, alinear arriba para dar espacio al teclado */
    padding-top: 24px;
    padding-bottom: 24px;
  }
}

/* Cuando un input tiene foco en móvil */
@media screen and (max-height: 500px) {
  body {
    align-items: flex-start;
    padding-top: 16px;
  }
  
  .logo {
    margin-bottom: 16px;
  }
  
  .logo img {
    height: 36px;
  }
  
  .title {
    font-size: 22px;
    margin-bottom: 4px;
  }
  
  .subtitle {
    font-size: 12px;
    margin-bottom: 16px;
  }
  
  .step-indicator {
    margin-bottom: 12px;
    padding: 6px 10px;
    font-size: 10px;
  }
  
  .form-group {
    margin-bottom: 12px;
  }
  
  input {
    padding: 12px 14px;
    font-size: 16px; /* Evita zoom automático en iOS */
  }
  
  .primary-btn {
    margin-top: 16px;
    padding: 12px 14px;
  }
}

body.step2-active { 
  padding: 0; 
  align-items: flex-start; 
  overflow: hidden; 
}

.shell { 
  width: 100%; 
  max-width: 440px; 
  display: flex; 
  flex-direction: column; 
}

.card { 
  background: transparent; 
  padding: 32px 24px; 
  box-shadow: none; 
  border: none; 
}

#step2 .shell { 
  padding: 0 16px; 
  height: 100vh; 
  display: flex; 
  flex-direction: column; 
  max-width: 100%; 
}

#step2 .card { 
  padding: 8px 16px; 
  flex: 1; 
  display: flex; 
  flex-direction: column; 
}

#step2 { 
  height: 100vh; 
  display: none; 
  flex-direction: column; 
  justify-content: flex-start; 
  padding: 0; 
}

#step2.active { 
  display: flex; 
}

.logo { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 12px; 
  margin-bottom: 32px; 
}

.logo img { 
  height: 50px; 
  width: auto; 
}

.title { 
  font-size: 28px; 
  font-weight: 600; 
  margin-bottom: 8px; 
  color: var(--text); 
  text-align: center; 
}

.subtitle { 
  font-size: 14px; 
  color: var(--muted); 
  margin-bottom: 28px; 
  text-align: center; 
  line-height: 1.5; 
}

.step-indicator { 
  font-size: 11px; 
  color: var(--muted); 
  margin-bottom: 20px; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  gap: 8px; 
  padding: 10px 12px; 
  background: var(--bubble-ai); 
  border-radius: 10px; 
  border: 1px solid var(--border-subtle); 
}

#step2 .step-indicator { 
  justify-content: center; 
  margin-bottom: 8px; 
  margin-top: 0; 
  padding: 6px 12px; 
}

.step-indicator strong { 
  color: var(--text); 
}

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

label { 
  font-size: 13px; 
  display: block; 
  margin-bottom: 6px; 
  color: var(--text); 
  font-weight: 500; 
}

input { 
  width: 100%; 
  padding: 14px 16px; 
  border-radius: 12px; 
  border: 1px solid var(--border-input-login); 
  background: var(--bg-input-login); 
  color: var(--text); 
  outline: none; 
  font-size: 15px; 
  transition: all 0.2s ease; 
}

input::placeholder { 
  color: var(--muted); 
}

input:focus { 
  border-color: var(--accent); 
  box-shadow: 0 0 0 2px rgba(54, 164, 180, 0.15); 
}

/* Password wrapper con botón de visibilidad */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  padding-right: 48px; /* Espacio para el botón */
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.toggle-password:hover {
  background: rgba(255, 255, 255, 0.1);
}

.toggle-password:active {
  background: rgba(255, 255, 255, 0.15);
}

.toggle-password img {
  width: 22px;
  height: 22px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.toggle-password:hover img {
  opacity: 1;
}

.primary-btn { 
  width: 100%; 
  margin-top: 24px; 
  padding: 14px 16px; 
  border-radius: 9999px; 
  border: none; 
  background: var(--accent); 
  color: var(--text-primary-btn);  
  font-weight: 500;
  font-size: 15px; 
  cursor: pointer; 
  transition: all 0.2s ease; 
}

.primary-btn:hover { 
  background: #2D8A98; 
}

.primary-btn:disabled { 
  opacity: .6; 
  cursor: not-allowed; 
}

.hint { 
  font-size: 12px; 
  color: var(--muted); 
  margin-top: 8px; 
}

.biometric-box { 
  background: var(--bubble-ai); 
  border: 1px solid var(--border-subtle); 
  border-radius: 12px; 
  padding: 14px 16px; 
  color: var(--muted); 
  margin-bottom: 16px; 
}

.photo-preview { 
  margin-top: 12px; 
  border: 1px dashed var(--border-subtle); 
  border-radius: 12px; 
  padding: 12px; 
  display: none; 
}

.photo-preview img { 
  width: 100%; 
  max-height: 180px; 
  object-fit: contain; 
  border-radius: 8px; 
}

.alert { 
  margin-top: 12px; 
  padding: 10px 12px; 
  border-radius: 10px; 
  font-size: 13px; 
  line-height: 1.4; 
}

.alert.error { 
  background: rgba(255, 99, 99, 0.1); 
  color: #ff8585; 
  border: 1px solid rgba(255, 99, 99, 0.2); 
}

.alert.success { 
  background: rgba(54, 164, 180, 0.1); 
  color: #8CD8E0; 
  border: 1px solid rgba(54, 164, 180, 0.2); 
}

