/* Gradiente en body para que cubra toda la pantalla sin huecos. */
body { background: linear-gradient(135deg, #6C3FC5 0%, #4B2A9C 100%) !important; }

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, #6C3FC5 0%, #4B2A9C 100%);
}

.login-card {
  max-width: 520px;
  width: 100%;
  padding: 1.75rem 2.5rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #6C3FC5, #4B2A9C);
}

.login-logo {
  margin-bottom: 0.5rem;
}

.login-logo img {
  max-width: 88px;
  height: auto;
}

.login-heading { margin-bottom: 1.25rem; }
.login-title {
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 0.15rem;
}
.login-subtitle {
  color: #718096;
  font-size: 0.9rem;
  margin-bottom: 0;
}

.form-control, .form-select {
  border: 2px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f7fafc;
}

/* Form de registro más compacto en vertical (no solo en móvil). */
#formAuthentication .mb-3 { margin-bottom: 0.85rem; }
#formAuthentication .form-label { margin-bottom: 0.3rem; font-size: 0.9rem; }
#formAuthentication .form-text { margin-top: 0.2rem; font-size: 0.8rem; }

/* Indicador de fuerza de contraseña */
.pwd-strength { margin-top: 0.45rem; }
.pwd-strength-bar {
  height: 6px; background: #e2e8f0; border-radius: 999px; overflow: hidden;
}
.pwd-strength-bar span {
  display: block; height: 100%; width: 0; border-radius: 999px;
  transition: width .25s ease, background .25s ease;
}
.pwd-strength-label { font-size: 0.8rem; font-weight: 600; }
.pwd-weak { background: #e53e3e; }   .pwd-weak-text { color: #e53e3e; }
.pwd-medium { background: #dd6b20; }  .pwd-medium-text { color: #dd6b20; }
.pwd-strong { background: #38a169; }  .pwd-strong-text { color: #38a169; }

.form-control:focus, .form-select:focus {
  border-color: #6C3FC5;
  box-shadow: 0 0 0 3px rgba(108, 63, 197, 0.1);
  background: white;
}

.form-label {
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 0.5rem;
}

.btn-login {
  background: #6D28D9;
  border: none;
  border-radius: 50rem;
  padding: 0.875rem 2rem;
  color: white!important;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.btn-login:hover {
  background: #5b21b6;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(109, 40, 217, 0.35);
}

.btn-link-action {
  border: 2px solid #e2e8f0;
  border-radius: 50rem;
  padding: 0.75rem 0.75rem;
  font-weight: 500;
  font-size: 0.9375rem;
  color: #6C3FC5;
  background: #f7fafc;
  white-space: normal;
  transition: all 0.3s ease;
}

.btn-link-action:hover {
  border-color: #6C3FC5;
  color: #4B2A9C;
  background: #fff;
}

.form-check-input:checked {
  background-color: #6C3FC5;
  border-color: #6C3FC5;
}

.form-check-input:focus {
  border-color: #6C3FC5;
  box-shadow: 0 0 0 0.25rem rgba(108, 63, 197, 0.25);
}

.alert { border-radius: 0.5rem; border: none; font-weight: 500; }
.alert-danger { background: #fed7d7; color: #c53030; }

/* Feedback de disponibilidad AJAX */
.field-status {
  font-size: 0.85rem;
  margin-top: 0.25rem;
  min-height: 1rem;
}
.field-status.is-checking { color: #718096; }
.field-status.is-available { color: #2f855a; }
.field-status.is-taken { color: #c53030; }

.input-with-status { position: relative; }
.input-status-icon {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  pointer-events: none;
}
.is-available .input-status-icon { color: #2f855a; }
.is-taken .input-status-icon { color: #c53030; }

#admin-fields {
  border-top: 1px solid #e2e8f0;
  padding-top: 1.5rem;
  margin-top: 1rem;
}

@media (max-width: 576px) {
  .login-container { padding: 1rem 0.75rem; }
  .login-card { padding: 1.5rem 1.25rem; margin: 0.5rem; }

  /* Logo más chico: el usuario empieza a escribir antes */
  .login-logo { margin-bottom: 1rem; }
  .login-logo img { max-width: 110px; }

  /* Compactar el espaciado vertical del form en móvil */
  #formAuthentication .mb-3 { margin-bottom: 0.85rem; }
  #formAuthentication .mb-4 { margin-bottom: 1rem; }

  /* Botón pegado arriba del teclado (sticky, no fixed: evita jank en iOS) */
  .login-submit-bar {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.97);
    padding-top: 0.75rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    z-index: 5;
  }

  .btn-link-action { font-size: 0.875rem; padding: 0.75rem 0.5rem; }
}
