/* ====================================
   SISTEMA MÉDICO - PANTALLA DE ACCESO
   ==================================== */

:root {
  --primary-color: #2b7fa0;
  --primary-dark: #1a5169;
  --primary-light: #e8f4f8;
  --success-color: #2ecc71;
  --danger-color: #e74c3c;
  --gray-light: #f8f9fa;
  --gray-border: #e1e5e9;
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Estructura base */
body.docinv-login {
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  background: linear-gradient(135deg, 
              rgba(26, 81, 105, 0.97) 0%,
              rgba(43, 127, 160, 0.95) 100%),
              url('../img/medical-bg.jpg') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Contenedor principal */
.login-wrapper {
  width: 100%;
  max-width: 440px;
  animation: fadeIn 0.6s ease-out;
}

/* Mejoras en tipografía */
.login-brand h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
  color: white;
  letter-spacing: 0.5px;
}

.specialty {
  font-size: 16px;
  opacity: 0.95;
  margin-bottom: 16px;
  font-weight: 400;
}

.login-title {
  font-size: 26px;
  font-weight: 700;
  color: #1a2b3c;
  margin-bottom: 10px;
}

.login-subtitle {
  color: #5a6c7d;
  font-size: 15px;
  margin-bottom: 0;
  font-weight: 400;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--primary-light);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.loading-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.loading-subtext {
  font-size: 14px;
  color: #5a6c7d;
  max-width: 300px;
  text-align: center;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Marca */
.login-brand {
  text-align: center;
  margin-bottom: 32px;
  color: white;
}

.logo-container {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto 16px;
}

.login-logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-soft);
  background: white;
  padding: 4px;
}

.brand-divider {
  width: 60px;
  height: 2px;
  background: rgba(255, 255, 255, 0.4);
  margin: 12px auto;
}

/* Tarjeta de login */
.login-card {
  background: white;
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: var(--shadow-medium);
  border: 1px solid var(--gray-border);
}

.login-header {
  margin-bottom: 28px;
}

/* Alertas */
.alert {
  border-radius: 12px;
  padding: 14px 16px;
  border: none;
  font-size: 14px;
  margin-bottom: 20px;
}

.alert-danger {
  background-color: #fee;
  color: #c33;
  border-left: 4px solid var(--danger-color);
}

/* Formulario */
.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
  font-size: 14px;
}

.icon-left {
  margin-right: 10px;
  color: var(--primary-color);
  width: 16px;
  text-align: center;
}

.form-control {
  border-radius: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--gray-border);
  font-size: 15px;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(43, 127, 160, 0.15);
  outline: none;
}

.input-group {
  border-radius: 12px;
  overflow: hidden;
}

.input-group .form-control {
  border-radius: 12px 0 0 12px;
  border-right: none;
}

.input-group .btn {
  border-radius: 0 12px 12px 0;
  border: 1.5px solid var(--gray-border);
  border-left: none;
  background: var(--gray-light);
  color: #6c757d;
  padding: 0 16px;
}

.input-group .btn:hover {
  background: #e9ecef;
}

/* Botón principal */
.btn-login {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(43, 127, 160, 0.25);
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(43, 127, 160, 0.35);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

/* Footer */
.login-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-border);
  text-align: center;
}

.security-info {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #95a5a6;
  font-size: 13px;
  margin-bottom: 8px;
}

.security-info i {
  font-size: 12px;
}

.copyright {
  color: #bdc3c7;
  font-size: 12px;
}

/* Animación */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 480px) {
  .login-card {
    padding: 30px 24px;
  }
  
  body.docinv-login {
    padding: 16px;
  }
  
  .login-brand h1 {
    font-size: 22px;
  }
  
  .login-title {
    font-size: 22px;
  }
}